This question already has an answer here:
I'm using vim for scripting and configs and noticed that I sometimes forget to open file with
sudo and therefore when I made some editings I got the error:
E45: 'readonly' option is set (add ! to override)
So I have to exit and make all the edits I just made for scratch. This is very annoying. Is there a way to approach it? Maybe I can switch from readonly mode without exiting vim?