A setting in my vimrc
(set noshowmode
) is being overridden by a plugin later in the loading process.
Have a VimScript file be executed last (or at least after plugins).
vimrc
(Source).after-directory
is run close to last and holds user overrides
(Source: :h after-directory
).runtimepath
determines the order of what is run.I tried appending a VimScript file (containing set noshowmode
) to the
end of $VIMRUNTIME
with
set runtimepath=$VIMRUNTIME,~/.vim/nosmd.vim
, but this method ended up
messing up other plugins (namely vim-airline
, which did not load).
I also tried creating the ~/.vim/after
directory and putting my
VimScript in there, but this had no effect.
set runtimepath=$VIMRUNTIME,~/.vim/nosmd.vim
That cannot work. 'runtimepath'
contains a list of root configuration directories; you cannot directly place script files in there. Instead, point to a directory that contains plugin/yours.vim
.
I also tried creating the
~/.vim/after
directory and putting my VimScript in there, but this had no effect.
You can check with :scriptnames
to see whether your script was executed (and at the end of the plugin load sequence!)
An ounce of prevention is better than any workaround. I would first try to locate the culprit who changes the 'showmode'
option; a plugin shouldn't do this (or at least have a configurable option to disable it).
:verbose set showmode?
might already tell you who changed this setting.
As @romainl already commented, ~/.vim/after/plugin/myplugin.vim
should work for undoing this. If it doesn't try the following autocmd (in your ~/.vimrc
) as a last resort:
autocmd VimEnter * set noshowmode