Thursday, October 27, 2011

Re: question about vim scripts.

On Oct 27, 4:04 am, gaoqiang <gaoqiangs...@gmail.com> wrote:
> I got an idea. just write several lines at the begging of .vimrc file:
> if !exists("g:already_read_vimrc")
>         let g:already_read_vimrc=1
>     finish
> endif
>

Better idea:

" first do any commands you want do before sourcing plugins, like
setting global options to be overridden by filetype-specific settings,
etc.

" then set up to source some other file, after everything else has
been loaded
autocmd VimEnter * source ~/.vim/source_me_last.vim

OR, as suggested earlier, put anything you want to source last, into a
file named ~/.vim/after/plugin/source_me_last.vim.

As mentioned before, sourcing your .vimrc after all plugins have
loaded is probably not really what you want. What SPECIFIC problems
are you trying to solve in this way? There's probably a better way to
solve them.

--
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

No comments:

Post a Comment