I am trying to create a (git) repository for my vim files. Now, I am already struggling as to what directory I would store my files under. As far as I can see there is either
%VIM%, right? Naturally, I feel more inclined to use
%VIM%. So I go
set VIM=x:\path\to\repo cd %VIM% notepad vimrc
to create a basic vimrc file in my repo. The
vimrc also contains
syntax enable. Now, when I start gvim and the startup process reaches the
syntax enable line, it gives an error message:
Error detected while processing x:\path\to\repo\vimrc
E484: Can't open file x:\path\to\repo\syntax\syntax.vim
This seems to be because vim automatically sets
$VIMRUNTIME to the value of
$VIM is set. This is of course not what I want, since I was happy with vim's default determining of
$VIMRUNTIME at startup. Neither do I want to globally set
%VIMRUNTIME% as I don't want to change it if I install a newer vim version.
So, what is the canonical way to keep my personal vim files in a repository?