I want to keep my Vim and Emacs configurations under version control, but I don't want my entire home folder there (or rather, I do, but there should be 3 separate repositories). With Emacs it's easy; if ~/.emacs
doesn't exist, then ~/.emacs.d/init.el
is used as the init file. So I can have a separate Git repo in ~/.emacs.d/
. With Vim, it seems .vimrc
can only exist in home folder and not in ~/vimfiles
(the equivalent to ~/.emacs.d
). Is this the best way to put .vimrc
under version control?
Just put a dummy .vimrc in ~ with just a single line:
source ~/path/to/real/vimrc
Works like a charm
Perhaps moving your .vimrc
to ~/.vim/
and symlinking to home will do?
Other, much more modular approach is to move your startup script to ~/.vim/plugins/
, perhaps create a subdirectory there, and single or multiple init scripts: Vim will do a :runtime! plugin/**/*.vim
when starting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With