I store my .vimrc
in my dotfiles repository located at ~/dotfiles/.vimrc
, which I want to manage with Git using vim-fugitive. I have symlinks from my home directory to my dotfiles, i.e. ~/.vimrc -> ~/dotfiles/.vimrc
.
I two problems with this:
- I can't do something like
:edit $MYVIMRC
, change something and run:Gcommit
, as fugitive does not follow symbolic links. Via the symlink my~/dotfiles/.vimrc
opens when running the edit command, but fugitive commands are not available. - In my
.vimrc
I define a number of autocommands that do use$MYVIMRC
- some of them do no longer work, because they also have their troubles with the symlink.
Both problems could be easily fixed if I could change the value of $MYVIMRC
, but I can't figure out how to do that. How can I change the value of $MYVIMRC
?
I understand that I can also just ignore $MYVIMRC
, i.e. replace it in all autocommands and not use it to edit my .vimrc
, but this seems not like a good solution.