I do most of my development on my MacBook Pro, however I have a nice 27” iMac at home, and it is refreshing to use it for development when I can. It’s fast and has a huge screen. The only downside is all my custom development configurations are on my MacBook Pro!
There are a number of options you can use to share settings between machines, but I’m a fan of using Dropbox (referral link). Any change I make, on either machine, will get automatically synchronized for me.
Since my Vim configurations were already present on my MacBook Pro, the first step was to copy them over to a Dropbox folder:
1 2 3 4 5 | |
The next step was to come up with an installer script that would symlink these files on a new machine. I made sure to move existing vim files to a temporary filename so that I wouldn’t lose anything accidentally.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
Make sure the script is executable by running:
1
| |
Then run this script on any new machine that you want to use Vim on. It will symlink these files from your Dropbox folder to your home folder:
.vim/.vimrc.vimrc.local.gvimrc
After it’s done, check that it is working. Remove any .bak files that you don’t need anymore.
And that’s it. You have an automatic Vim configuration synching system between machines. It works great for your shell configuration as well!