25 October, 2013

VIM Trick: Forgot to sudo before editing the file?

" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
Reference: http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work

No comments: