Re: ~/.vimrc under windows
- Mathias Michaelis wrote:
> Hello NeilNeil:
>> I would like to know where to place my personal .vimrc when using
>> gvim under Windows and where I should place it.
> I think the best way is to open vim or gvim and then type
> :echo $HOME
> On the other hand, if you open a dos or cmd window and then type `echo
> %HOME%´, as others have suggested, you may get the stupid output
> `%HOME%´ only, because %HOME% may not be defined. However, within vim or
> gvim the $HOME variable is always defined somehow (as
> %HOMEDRIVE%%HOMEPATH% if %HOME% is not defined, else as %HOME%)
> I use to place my personal vimfiles directory also to the place that vim
> shows by `:echo $HOME´. Within the vimfiles directory you can put
> personal plugins, syntax color definitions etc.
> I hope that helps.
On any platform, ":version" will tell you where your particular version
of (g)vim looks for startup scripts. Use the method above to evaluate
any environment variables in the answers. Note that if a filename
starting with an underline is not found, the same name is searched again
with an initial dot instead (and vice-versa on Unix-like systems).
The reason why the vimfiles directory is there is because, as you
probably know, that's where the default for the 'runtimepath' option
(q.v.) puts it. Under Unix it is called $HOME/.vim rather than
$HOME/vimfiles but the system-wide equivalent (for customizations that
didn't come with the Vim distribution) is still $VIM/vimfiles .
P.S.: Sorry if I sound pedantic: I'm a retired lower-high-school teacher
and sometimes it shows.