Sometimes it happens that I open a file and make some modifications as my own
user, without noticing or "forgetting" to noticing the [read-only]
warning in
the status line (ie. some random /etc
config file like /etc/resolv.conf
).
:w!
obviously fails in this case because my user has no write permission
anyway. So I have to :w /home/filename
, exit and sudo mv ...
, very
uncomfortable.
Is there a way so that I escalate temporarily to root to be able to save the
file currently opened? (given I am in sudoers
or/and I can su
directly)?