I have a ~/.vim under version control and my "real" vimrc (the one with all my settings) inside this directory, ~/.vim/vimrc :
~/ ---- .vim/ ---- ---- (plugins and stuff) ---- ---- vimrc ---- .vimrc
My regular ~/.vimrc has only one line:
runtime vimrc
No need to create symbolic links or anything else.
Here's how I would push my configuration on a new computer where Git is already installed:
$ cd $ git clone git@github.com:romainl/dotvim.git .vim $ echo "runtime vimrc" > .vimrc
The following is the entire creation process. I assume that you have created an account and repo named vimconfig on Github and that you already have a lovingly created ~/.vimrc and a well organized ~/.vim/ .
$ cd $ mv .vimrc .vim/vimrc $ echo "runtime vimrc" > .vimrc $ cd .vim $ git init $ echo "This is my Vim config." > README $ git add * $ git commit -m "My Vim config is versioned." $ git remote add origin https://github.com/username/vimconfig.git $ git push origin master
At this point, you should have the same content on Github and in your local repository.
Usually you manage this repository and push your commits when you are ready. Plain.
Please note that all Github work is useful only when you need / need to synchronize your configuration on several computers or somehow need / want to share it with others. If you do not, there is no real point on GitHub.
(edit)
Vim 7.4 introduced a new, very useful scheme: it is looking for the usual ~/.vimrc , as well as for ~/.vim/vimrc , to work even less for you:
$ cd .vim $ git init $ echo "This is my Vim config." > README $ git add * $ git commit -m "My Vim config is versioned." $ git remote add origin https://github.com/username/vimconfig.git $ git push origin master
Of course, the strategy I proposed is still valid if you have to deal with mixed versions of Vim: Vim knows what to do and will not crash in an endless loop.
romainl Aug 13 '13 at 7:53 on 2013-08-13 07:53
source share