Wednesday, June 6, 2012

[Level 2] How to get root permission to write file.

If you want to get root permission when you launch vim with normal user. You could try the following command in vim. 1. to write to file. 2. reload the file.
:w !sudo tee [file_name]
:e!

Wish this helps.

regards,
Stanley Huang