In Vim, save a file you edited in vim without the needed permissions
:w !sudo tee %
Via Stefan Freudenberg via colleagues at Zeit, add this to your .vimrc file and you can always just use ":W" instead of ":w".
{syntaxhighlighter BASH}command W :execute ':silent w !sudo tee % > /dev/null' | :edit!{/syntaxhighlighter}
More information about formatting options
Comments
Even better!
Via Stefan Freudenberg via colleagues at Zeit, add this to your .vimrc file and you can always just use ":W" instead of ":w".
{syntaxhighlighter BASH}command W :execute ':silent w !sudo tee % > /dev/null' | :edit!{/syntaxhighlighter}
Post new comment