Getting root permissions on a file inside of Vim

Getting root permissions on a file inside of Vim

Sometimes you open a file that you need root permissions to save it.
When it happen, you can close and reopen the Vim (with sudo) or you also can do:

:w !sudo tee %

Thanks to @dlisboa for the tip.

Comments are closed.