Last Updated: February 20, 2016
·
1.056K
· arhuman

Modify a file you opened with vim without the proper access rights.

:w !sudo tee %

or if you don't even want to recall it, map it in your vim's config file :

cmap w!! %!sudo tee > /dev/null %