This is a basic experiment in vimrc scripting. Its a conditional load of an
option based on the existence of a global variable set in a sourced vim config
file which is loaded by filetype autocommand.
These are in my .vimrc=
"Adds another vimrc file with other settings...
:autocmd FileType html source $HOME/.vim/html_vimrc.vim
"
"Test if var set in html_vimrc exists...
:if exists("g:prog")
: let g:ok_prog=1
:endif
In .vim/html_vimrc.vim is this line:
:let g:prog=1
This has two test cases. Using :let command to check for the existence of the
named g:vars: test.vim, test.html shows that the variable is not available to
test.vim. It is available to test.html; however, in the resulting let display,
it is listed before, above, the g:prog var. Evidently its not available to the
conditional test.
The question is this true? Does the position of the g:var displayed with :let
command represent the processing order. And if yes, how can I change this order
to and still keep the files separate?
PS. I tried this first my conditional test with :number option.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php