Tuesday, August 16, 2011

Quick tip: Save without permissions in VIM

Like many others I use VIM for my daily work. And like many others I often forget to open files with the right permissions (i.e. sudo vim ...).

To save a file that you need special permissions for, do the following:

:w !sudo tee %

this will allow you to save the file even though you do not have the right permissions (You need to have sudo rights of course).

More tips can be found here.

No comments: