I have the following in my vimrc:
call plug#begin()
Plug 'https://github.com/vim-scripts/RltvNmbr.vim'
call plug#end()
set number
RltvNmbr
When I type :so %
while in my vimrc, it will turn on the relative line numbers with no error message.
However if I :q
and reopen that same vimrc, I get:
E492: Not an editor command: RltvNmbr
Press ENTER or type command to continue
I was under the understanding that opening a file in vim automatically sources the vimrc. Thus I do not understand why I get the above error when opening a file in vim, but not when manually sourcing the vimrc.
:h startup
or check the output of the:scriptnames
command. So perhaps you need to use anVimEnter
autocommand to call theRltvNmbr
command?au VimEnter RltvNmbr
but that didn't seem to do anything. I have other plugin-related commands being executed after mycall plug#end()
and those don't seem to be causing any problems...au VimEnter * RltvNmbr
call plug#end()
?