I have these commands in my ~/.vim/ftplugin/markdown.vim
:
setlocal spell spelllang=en
When I open a Markdown file, however, 'nospell'
is in effect; output of :verbose set spell?
shows the "last set" location was my ftplugin, but the values are wrong:
nospell
Last set from ~/.vim/ftplugin/markdown.vim
spelllang=
Last set from ~/.vim/ftplugin/markdown.vim
Same thing happens if I put the setting in ~/.vim/after/ftplugin/markdown.vim
, or in an autocmd:
autocmd FileType markdown setlocal spell spelllang=en
Also happens with :set
instead of :setlocal
.
I logged messages with :echomsg
to prove that the ftplugin was being sourced (it is), and I used :redir
inside the ftplugin to show that the settings were correct at the end of the file (also at the end of the "after/ftplugin" file):
redir >> /tmp/log
verbose set spell? spelllang?
redir END
I tried to see what could be overriding it by doing:
:set verbosefile=/tmp/log
:set verbose=20
:e /tmp/some.md
:q
but I can't see anywhere that could be overriding it.
And I tried grepping inside $VIMRUNTIME
and ~/.vim
to see if I could find any files that might be setting 'spl'
or 'spelllang'
, but there doesn't seem to be anything that could be getting loaded upon accessing a Markdown file that could do this.
Same settings (setlocal
in an ftplugin file) work just fine for other filetypes, such as "mail", and in fact this setting used to work just fine for Markdown files too, but at some point it stopped working.
Happens in Vim and Neovim (tested on v8.0 with patches 1-1350, and v0.2.2 respectively).
Any idea how I can get to the bottom of this?