Change Default Location of .vimrc to Inside ~/.vim/

vim

I use git to persist my ~/.vim directory. I'd like to store my vimrc file in this directory as well so that it will also live in the repository. How do I change the location where Vim searches for the vimrc file?

Best Answer

You don't. Symlink it instead.

mv ~/.vimrc ~/.vim
ln -s  ~/.vim/.vimrc ~/.vim

You cam do the symlink thing to sync your vimrc through Dropbox as well.

Related Question