Skip to content

Instantly share code, notes, and snippets.

@yaasita
Created July 19, 2014 13:47
Show Gist options
  • Save yaasita/9f10bdc30309f9ad1f89 to your computer and use it in GitHub Desktop.
Save yaasita/9f10bdc30309f9ad1f89 to your computer and use it in GitHub Desktop.
autocmd BufWritePost $MYVIMRC call WriteVimrc()
function WriteVimrc()
if bufexists(expand("~/backup/dotfiles/.vimrc"))
return
endif
if filewritable(expand("~/backup/dotfiles/.vimrc")) == 1
w! ~/backup/dotfiles/.vimrc
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment