How to save in Vim using sudo

You can still write on a file that needs root permission, even if you forgot to open Vim with _sudo_:
```
:w !sudo tee %
```
The main trick here is using _tee_ as a hack.

Nick Ciolpan
08 May 2018
« Back to post