:help startup
states, under 3. Execute Ex commands, from environment variables and/or files
that (for Unix systems) $HOME/.vimrc or $HOME/.vim/vimrc
is read and that The files are searched in the order specified above and only the first one that is found is read.
I do have a (read/writeable) ~/.vim/vimrc file, so I have expected this file to be read first.
However, when I start gvim
(debugged with the -V20
flag) I see that gvim first reads /usr/share/vim/vimrc
. When it is finished reading this file, it then reads my ~/.vim/vimrc
file. I don't want the /usr/share/vim/vimrc
file to be read at all.
The environment variable $VIM
is not set.
Interestingly (and somewhat surprisingly for me): after gvim is started up fully, :echo $MYVIMRC
prints /home/rene/.vim/vimrc
.
So, my questions are: why does it behave differently from what is stated in the help file and how do I make sure that only ~/.vim/vimrc
is read.