Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to backup vim configuration with plugins?

Tags:

vim

I understand to backup my vimrc file but what about my plugins? Will I have to reinstall them 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) ?

like image 875
darren Avatar asked Feb 24 '11 10:02

darren


People also ask

Where are Vim config stored?

The system vimrc should normally be left unmodified and is located in the $VIM * directory.

Where do I put Vim plugins?

You can place Vim plugins in the ~/. vim/pack/vendor/start/plugin_name directory. Note that the plugin_name folder name will vary from plugin to plugin.

What is a vimrc file?

The vimrc file contains optional runtime configuration settings to initialize Vim when it starts. On Unix based systems, the file is named .vimrc , while on Windows systems it is named _vimrc . : help vimrc. You can customize Vim by putting suitable commands in your vimrc.

Do I need to source vimrc?

vimrc . If you use a plugin manager like Vundle and keep the list of plugins in ~/. vimrc , then you'll need to source it after changing the list of installed plugins. There's no need to quit and restart!


3 Answers

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.

like image 164
DrAl Avatar answered Nov 03 '22 22:11

DrAl


This might help: http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/

like image 27
Flavius Stef Avatar answered Nov 03 '22 22:11

Flavius Stef


In most cases taking the directories with you should do the trick.

like image 4
Sarah Avatar answered Nov 03 '22 22:11

Sarah