» Sync Vim Config Across Workspaces

As a Vim newbie, I'd like my Vim plugins & configuration to stay in sync between machines at home, office, my servers & a laptop.
If found that a (free) Dropbox account works like a charm.

First copy your best config to your Dropbox:

# In this setup, your config will be accessible by the world
mkdir -p  ~/Dropbox/Public/configs/vim
cp -raf ~/.vim  ~/Dropbox/Public/configs/vim/.vim
cp -raf ~/.vimrc  ~/Dropbox/Public/configs/vim/.vimrc

Next, on all machines, purge the currently installed vim config:

mv ~/.vim* /tmp/

.. and symlink the Dropbox's config in place:

ln -nfs ~/Dropbox/Public/configs/vim/.vim ~/.vim
ln -nfs ~/Dropbox/Public/configs/vim/.vimrc ~/.vimrc

Now when you change your Vim config anywhere, changes will be synced to all the workstations that you have set up this way.

Get config on untrusted machines

Extra perk: because we use the Dropbox Public folder, you can even access your config on machines that aren't connected to your Dropbox by using wget:

wget -O- http://dl.dropbox.com/u/XXXXXX/configs/vim/.vimrc > ~/.vimrc
# - Change XXXXXX with user id (or right click the config, copy public link)
# - Just the main config, no plugins (use a zip or web interface for that)

Trusted servers (no GUI)

On trusted servers, you can even install Dropbox without a GUI :D

32bits

cd /usr/src
wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86
tar -zxof dropbox.tar.gz
.dropbox-dist/dropboxd &

64bits

cd /usr/src
wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86_64
tar -zxof dropbox.tar.gz
.dropbox-dist/dropboxd &

Then

Follow the instructions on screen.
The Dropbox folder is located at ~/Dropbox as usual.

To make sure Dropbox will load on startup run:

dropbox autostart

Afterwards symlink the config like you would normally.

You Probably Shouldn't Follow Me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: ide, programming, vim, dropbox
category: Programming
read: 9,319 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#2. Eduardo on 17 August 2011

Gravatar.com: EduardoYou could use github too! You can creat a github (git) repo and clone it in every machine. Checkout github.com/mmacia/dotfiles or github.com/egulias/dotfils.

I'm learning VIM too!

#1. Chiara on 04 December 2010

Gravatar.com: ChiaraDropbox is great. I do the same thing with my .bashrc file.