:w !sudo tee %
But let's say we want this to be a little more automatic task, well I found this trick very useful which consists of adding the following line to your ~/.vimrc file:
cmap w!! w !sudo tee > /dev/null %
So now you just need to execute:
:w!!
to get this done.
No comments:
Post a Comment