On 21/02/09 11:57, Benct Philip Jonsson wrote:
> Does vimrc have to be ~/.vimrc or can it be ~/.vim/vimrc
> too?  I'm on Ubuntu, BTW.
>
> /BP

Vim (when loaded without the -u command-line argument) will look in the 
following places for a user vimrc script on Linux (see ":help .vimrc"):

1) $HOME/.vimrc         (the standard Unix location)
2) $HOME/_vimrc         (for W32 compatibility on double-boot systems)
3) $HOME/.exrc          (for compatibility with vi)

Nothing else (for a script; see below for a naked ex-command). 
$VIM/.vimrc is checked on Windows, but not on Unix-like systems, because 
on the latter, $HOME can be expected to exist and have a meaningful value.

Also, sourcing a user vimrc (but not a user exrc) sets 'nocompatible' if 
neither -C nor -N was used on the command-line when invoking Vim.

Note: Vim doesn't "know" that you are or aren't on a double-boot system. 
Vim for Unix/Linux uses the first one found (if any) among all three 
locations mentioned above. Additionally, if the environment variable 
$VIMINIT is set its value is used as an ex-command instead of checking 
the above-mentioned locations, and if $EXINIT is set, its value will be 
used as an ex-command if no vimrc is found (and before looking for an 
exrc). I personally don't recommend using those environment variables 
except in very exceptional cases (a script is a more versatile way to 
set up the editor).

If you prefer to have the "flesh" of your vimrc in a different location, 
you can always create a ~/.vimrc with hardly anything other than a 
"source" command (see ":help :source").


Best regards,
Tony.
-- 
Democracy, n.:
        A government of the masses.  Authority derived through mass
meeting or any other form of direct expression.  Results in mobocracy.
Attitude toward property is communistic... negating property rights.
Attitude toward law is that the will of the majority shall regulate,
whether it is based upon deliberation or governed by passion,
prejudice, and impulse, without restraint or regard to consequences.
Result is demagogism, license, agitation, discontent, anarchy.
                -- U. S. Army Training Manual No. 2000-25 (1928-1932),
                   since withdrawn.

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

Reply via email to