Save a file in vim without the needed permissions
Very often, you opened a file using vim, edited it and find out that the file is opened as read only, i.e. you don't have permission to make any change(s).
What will you do? Simplest method is to save it into a temp file and rename it afterward.
However, there exist a simple method that allow you to save the file anyway.
Instead of using :wq, you enter the following.
:w !sudo tee %
That is what you need.