How to save the edited file in read-only VIM

We often encounter this scenario: edit a system configuration file in the VIM, found when needed to save the file permissions of the current user is not written
at this time how to do it?
When you need to save time, enter the following command:

:w !sudo tee %

Guess you like

Origin www.cnblogs.com/freedom-try/p/11866230.html