I am testing the conditional loading of VIM settings. Below is a test script and its not working properly. I've read the
VIMDOCS and followed the instructions there for conditionals. The vimrc right now correctly loads filetypes,
This html_vimrc file has both (which I alternatively comment to test the different blocks),
Code:
:let g:prog=1
:set number
This is the main vimrc,
Code:
"Load additional settings for html file type
:autocmd FileType html source $HOME/.vim/html_vimrc.vim
"Test conditional using global variable set in html_vimrc,
:if !exists("g:prog")
: set spell
:else
: set nospell
:endif
"Test conditional using vimrc setting number set in html_vimrc,
:if (&number==0)
: set spell
:else
: set nospell
:endif
I've tried if (&number), if &number, if (&number=="0"), if (&number=="number"). The result is always the same in all my tested variations. The result test "spell" consistently returns on-on or off-off, and, of course, the desired result is on-off.