Reputation: 187
I would like to always open a vertical split with Explore whenever I open a file in vim. So I added the following list to my init.vim
topleft vsplit | :vertical resize 30 | :Ex
however I get the following error message.
Not an editor command: :Ex
Upvotes: 0
Views: 2416
Reputation: 15186
however I get the following error message.
So the command is invalid. :Ex
is provided by a plugin (usually netrw). The message means that netrw is not loaded (yet).
I added the following list to my init.vim
Please, take your time reading :h startup
. To put it short, vimrc
(or init.vim
) is processed long before any plugin is loaded. You really should delay your command until VimEnter
event. Kind of
if v:vim_did_enter
DoSomethingIfSourcedManually
else
autocmd VimEnter * ++once ++nested DoSomethingOnStartup
endif
Upvotes: 2