Last Updated: February 25, 2016
·
703
· caioariede

Vim: Saving files as root after opening

Sometimes you open a file that requires root privileges and just forget about opening it with sudo. Not a problem, just save it with sudo directly from Vim:

:w !sudo tee %