I am using Dropbox . I created a vim
folder in my Dropbox that contains my .vimrc
directories (actually: vimrc.vim
) and colors
, plugin
, etc.
Dropbox pushes all these files to all of my computers (home, work, laptop, Bootcamp), so every time I want to change my vimrc
, I can do this and I don’t have to worry about copying the correct directory or checking the file from SVN or something else. Everything happens automatically!
My actual .vimrc
contains only what is needed to download the material that I have in my Dropbox. On OSX and Linux, it looks like this:
set runtimepath^=~/Dropbox/vim source ~/Dropbox/vim/vimrc.vim
On Windows, for example:
set runtimepath^=$HOME/My\ Documents/My\ Dropbox/vim source $HOME\My Documents\My Dropbox\vim\vimrc.vim
What is it!
(Actually, I put vimrc
higher in my Dropbox, so I don’t need to remember them every time I set up a new computer or reinstall an old one.)
The free version of Dropbox will give you a 30-day change history, the paid one will give you a complete change history. Please note: if you are running Linux, this is easiest if you are using GNOME, for which Dropbox has a nice client.
Conditional settings
If you have small configuration changes that you would like to use on different machines, this is a convenient solution:
create a small function in each of your .vimrc files to return the type of system you are on:
fun! MySys() return 'linux' endfun
then in your global vimrc.vim file:
if MySys() == "linux" set backupdir=./.backup,/tmp set directory=./.backup,/tmp elseif MySys() == "windows" set backupdir=$HOME/AppData/Local/backup,$HOME/AppData/Local/tmp set directory=$HOME/AppData/Local/backup,$HOME/AppData/Local/tmp endif
Alternatives to Dropbox
There are many cloud storage and sync services, Dropbox is just one example. OpenSource services such as http://sparkleshare.org/ and http://one.ubuntu.com exist, but you are encouraged to search the Internet for the solution that best suits your needs.