On Sat, May 2, 2009 at 4:41 AM, Gary Johnson wrote:
>
> On 2009-05-02, Nicolas Aggelidis wrote:
>> Now i have the following code on my vimrc
>>
>> "for windows
>> if has("win16") || has("win32") || has("win64")
>>       source  $HOME/vimfiles/key_bindings.vim
>>       source  $HOME/vimfiles/matchings.vim
>> "for unix
>> else
>>       source  $HOME/.vim/key_bindings.vim
>>       source  $HOME/.vim/matchings.vim
>>
>> endif
>>
>>
>> i tried using a .vim folder in windows, but i noticed that in this
>> case colorschemes(colors folder, located in .vim/colors) weren't
>> loaded....
>
> That's because color schemes and other plugin files are loaded from
> directories rooted in the directories of your 'runtimepath'.  For
> Unix, the 'runtimepath' includes $HOME/.vim whereas for Windows, it
> includes instead $HOME/vimfiles.  See
>
>    :help runtimepath
>
> Is there any reason you need to source those files in your vimrc
> rather than putting them in your $HOME/.vim/plugin or
> $HOME/vimfiles/plugin directory and having vim source them
> automatically?  If you could do that, you wouldn't need any source
> commands at all in your vimrc.  See
>
>    :help 05.4

Even if you can't make them plugins, you can rely on the fact that
they're in a directory that's in 'runtimepath' on both OSes to remove
the need for :source:

runtime key_bindings.vim
runtime matchings.vim

This should be pretty safe, since a) you're using the non ! form of
runtime, meaning only the first file in the runtimepath with each name
will be sourced, b) no default files with either of those names exist,
and c) you're placing them in the first directory of runtimepath in
both OSes

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to