How to backup vim configuration with plugins?
I understand to backup my vimrc file but what about my plugins? Will I have to reinstall t开发者_如何学JAVAhem if I move to another machine? Or can I just copy paste the directories in my vim folder ( but what if i go from windows to linux) ?
Generally, it is sufficient to take the vimfiles
/.vim
directory with you. However, in my experience the Linux builds of Vim are much more fussy about plugin line-endings than the Windows ones. Therefore, it is worth checking that all of your plugins and other vim configuration files have Unix line endings so that they work on Windows and Linux without issues.
In my set-up, I have the whole of .vim
under version control: this makes synchronising multiple computers very straightforward. To make this work well, put your _vimrc
into your vimfiles
directory and name it (e.g.) vimrc
. Then in the place where you normally have _vimrc
add a file with this content:
runtime vimrc
Do the same for _gvimrc
if you have one. This means you can keep everything in one folder (plugins and vimrc
) and keep that folder under version control or just synchronise it by some other means if you prefer.
This might help: http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/
In most cases taking the directories with you should do the trick.
精彩评论