I believe the following script in vimrc, which try to set spellfile
, has something to do with the scope of vim variable. Especially the difference of $var
and g:var
:
I can't figure out what's wrong with this:
let g:spelldir ='~/.vim/myvim/spell'
if !exists( 'g:spelldir' )
silent exec '!mkdir -p ' . g:spelldir
endif
au FileType tex setlocal spf= g:spelldir/en.utf-8.add
while it works if we change g:spelldir
to $spelldir
.