On 2011-11-14, Peng Yu wrote:
> Hi,
> 
> I'm developing some indent and syntax files. Instead of putting them
> in ~/.vim. I'd like to put them in a different directory. In order to
> load them automatically, I think that I just need to append the
> directory to runtimepath. Is it going to cause some problems if the
> files are not in ~/.vim?

It doesn't matter what the directory name is as long as it is in
'runtimepath'.

> If there is already files with the same name (for example older
> versions) in ~/.vim, will the one not in ~/.vim be able to mask the
> ones in ~/.vim?

It depends.  Some plugin files include a preamble that causes only
the first one sourced to be read completely.  See for example,

    :help 41.12

Such a preamble is typically used by ftplugin, indent and syntax
files, but not by after/ftplugin, after/indent or after/syntax
files.

So if you're developing some ftplugin, say foo.vim, and you don't
want any other ftplugin/foo.vim file in your 'runtimepath' to be
sourced, then first make sure you include a preamble as described
above.  Second, make sure that your development directory comes
before any other directory in 'runtimepath'.  For example, use this
in your ~/.vimrc,

    set rtp^=~/vimdev

and name your development file ~/vimdev/ftplugin/foo.vim.

On the other hand, there is no standard mechanism for preventing an
"after" plugin from being sourced.

Regards,
Gary

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

Reply via email to