Skip to content

Instantly share code, notes, and snippets.

@bonnerl
Created November 8, 2016 15:55
Show Gist options
  • Select an option

  • Save bonnerl/258f4deaa8d767b165ed5dee0149bd79 to your computer and use it in GitHub Desktop.

Select an option

Save bonnerl/258f4deaa8d767b165ed5dee0149bd79 to your computer and use it in GitHub Desktop.
Put this in .vimrc and use :w!! to save a file as sudo when you forgot to open it as sudo.
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment