On 04/11/08 17:34, 703designs wrote:
> What's the shortcut (like $HOME, $VIMHOME, etc.) for the user's .vim
> or vimfiles directory? I use the same settings on a Mac and on
> Windows, and this is the main obstacle to making my sources work
> seamlessly cross-platform.
You can examine the contents of 'runtimepath' until the first comma
excluded (as already said), or you can differentiate based on the
results of has('unix') on the one hand, has('win32') || has('win64') ||
has('win16') || has('dos16') || has('dos32') on the other hand (and
since Vim uses short-circuit evaluation, it is marginally faster if you
order the terms of an "or" clause by decreasing truth frequency).
$VIMRUNTIME is used on all platforms, but should only be used for
scripts distributed with Vim;
$VIM/vimfiles is used on all platforms for system-wide extensions to the
above;
$HOME/.vim is used on Unix (possibly including Mac OS X but not
Classical Mac) for single-user extensions to any of the above;
$HOME/vimfiles is the Windows equivalent of $HOME/.vim.
All these except $VIMRUNTIME can also include an after/ subdirectory
with the same tree structure, see |after-directory|.
These are only the defaults. It is possible (but not recommended) to
alter any of them via the 'runtimepath' option.
Normally, adding or removing 'runtimepath' scripts is done either
manually, or by means of the Vimball plugin, which takes care of the
above differences (see the help for ":UseVimball", ":RmVimball", etc.).
To _invoke_ a script which is in one of these directories, you don't
need to know where they are stored, only the specific path under any or
all of them, see ":help :runtime", so e.g.:
(in vimrc)
runtime vimrc_example.vim
(in syntax/cpp.vim)
runtime! syntax/c.vim
etc.
Best regards,
Tony.
--
It is impossible to experience one's death objectively and still carry
a tune.
-- Woody Allen
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---