Created
November 8, 2016 15:55
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 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