Wednesday, February 2, 2011

Re: Sourcing an arbitrary vimscript right after all vimrc files have been executed?

On 02/02/11 17:51, Dun Peal wrote:
> Hi.
>
> I read about the -S command line flag, as well as the --cmd flag.
>
> Problem is, I need to source an arbitrary vimscript right after all
> vimrc files have been read, but before the first file has been read.
> So --cmd is too early for me, while -S is too late.
>
> What I need is a flag --foo, such that:
>
> vim --foo bar.vim
>
> Would act as if the following line has been appended to ~/.vimrc:
>
> source bar.vim
>
> Does such a thing exists?
>
> Thanks, D
>

You could drop that additional script (or, if your system allows it, a
soft link to it) in (on Windows) ~/vimfiles/plugin/ or (on Unix)
~/.vim/plugin/ -- all *.vim files found there will be sourced before
loading the buffers (and, in fact immediately before the standard
plugins in $VIMRUNTIME/plugin). If the directory does not exist, just
create it before you use it.

Best regards,
Tony.
--
Swipple's Rule of Order:
He who shouts the loudest has the floor.

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