I am not a very orderly person at times and I often find myself in the situation of losing my old fully tweaked vimrc file and having to start over all again. Or having differen
What works best for me is to put the following in my .vimrc
file:
set nocompatible
let $localcloudpath = $MYVIMRC . '_cloud'
let $cloudurl = '!curl https://bitbucket.org/<USERNAME>/vimrc/raw/master/global -o '. $localcloudpath
silent execute $cloudurl
source $localcloudpath
This way, every time I run vim, it downloads and uses the latest .vimrc
file from my BitBucket repository. It will use the last downloaded .vimrc
if connection to the internet doesn't exist.
The only requirement (apart from an active internet connection) is you need CURL installed.
If you don't want to download the latest .vimrc
every time, then just comment out the curl line:
" let $cloudurl = '!curl https://bitbucket.org/<USERNAME>/vimrc/raw/master/global -o '. $localcloudpath
BitBucket is also a personal preference because I can easily edit the file online without having to commit anything but you can host your .vimrc
file anywhere with a publicly accessible URL (Dropbox, Google Drive, GitHub, etc.)
UPDATE (16/10/2017)
Using the below updated curl command will always get fresh .vimrc
from bitbucket. It will also timeout and use the last downloaded .vimrc_cloud
if you are offline or on a slow connection.
let $cloudurl = '!curl -H "Cache-Control: no-cache" --max-time 10 https://bitbucket.org/<USERNAME>/vimrc/raw/master/global -o '. $localcloudpath
There is also a very nice way to install plugins using Version Control, Since most of the VIM plugin are available on GITHUB it also help.
Please see this Article which tells you how to keep your .VIM file synchronized using GIT, and load plugin as a sub module with the help of PATHOGEN plugin.
Use GIT for Syncing VI plugins
In short of what is mentioned in the vimcast and i am quoting from the Blog.