Portable Vim Configuration via Dropbox
Use Vim? Use Dropbox? Here is an easy way to have your whole vim setup follow you around the internet (or at least to any computer you sync your Dropbox account to)
Move your current ~/.vim
setup to your Dropbox share. I just use a directory called ~/Dropbox/vim
. Rename your ~/Dropbox/vim/.vimrc
file to ~/Dropbox/vim/vimrc.vim
(this step is entirely optional, but the source command in the following section will have to be updated accordingly.
Now, update your ~/.vimrc
file to the following contents
set runtimepath+=~/Dropbox/vim
source ~/Dropbox/vim/vimrc.vim
This will configure vim to look at ~/Dropbox/vim
as it's runtime path for all plugins, and configuration and then source your new vimrc.vim
file at startup.
Now all you need to do is add this new, short two-line vimrc file to any computer where your Dropbox is synced and you can have your full vim setup instantly. New plugins or changes you make to your configuration will be synced to Dropbox and follow you around to all your other machines.
Written by Craig P Jolicoeur
Related protips
5 Responses
For those who use Git, Vundle is an easy way to install/update/remove plugins for Vim.
@w0ng Interesting, I'll check that out. I use Pathogen currently, but wasnt aware of Vundle
Hey, nice solution! Is there any possibility to open this dropbox vimrc directly? Something similar to ":e $MYVIMRC". Thanks
Sure you could set any kind of ENV variable you wanted to point to the vimrc file inside dropbox.
If you're using vundle, you need to change the directory where the plugins are installed as well: