Tim Chase wrote:
> If you've been on the list a while, a couple weeks back Tony gave
> a stern warning to those attempting to point their $VIMRUNTIME to
> unexpected places (on pain of later headaches). It's usually
> best to just let vim look in the places it expects--it tends to
> make upgrading fairly painless. The only difficulty I've had has
> been on Win9x/ME where the notion of a "$HOME" isn't as well
> defined. However, it seems to work more gracefully elsewhere.
Yes, IMHO "following the standards" is usually better than "bending them
to one's will". There are a few exceptions, but in any case you
shouldn't "bend the standards" unless you know exactly what you do and
why there's no simpler way to do it.
About $HOME: On Windows, where the HOME environment variable isn't
always defined, you can always set it up: for instance, on a single-user
Win9x system you can add
(or any other suitable value) to your C:\AUTOEXEC.BAT; or on multiuser
NT/XP systems, you can follow the menus, "Control Panel -> System ->
Advanced -> Environment variables", and check in the bottom pane
(Variables for this user only) that HOME is defined and that its value
is correct. (Or maybe it will be defined in the top pane by means of
variables that vary from one user to the next, such as
%HOMEDRIVE%%HOMEPATH%). In any case, ":echo $HOME" in Vim will show you
what (if anything) Vim is currently using as a home directory.
If you don't want to set HOME permanently in Windows (though I recommend
to do it), another possibility is to create a "system vimrc" (i.e.,
$VIM/vimrc without leading dot or underscore) to define it, e.g.:
if $HOME == ""
let $HOME = $HOMEDRIVE . $HOMEPATH
if $HOME == ""
let $HOME = "C:\"
(the second "if" takes care of the case where the first one wouldn't set
up anything). -- Note: Beware of "tiny" versions of Vim, compiled
without expression evaluation, where anything between "if" and "endif"
would get bypassed.
In theory, you could even set up $HOME in your _vimrc, except that it
would be set up too late to help you find $HOME/_vimrc