Domo is Fugito. This time, "** The file edited with vim was readonly, but I want to save my edits ** "About the problem.
(Fugito-kun, a new engineer. It looks like I edited the file with vim today. )
"** Oh, I can save the edited content **"
E45: 'readonly' option is set (add ! to override)
"Senior, I can't save the edited content." "Ah Fugi and you, this is a read-only file The principle can be edited and it is a specification. " "Is it true? It's a rewrite ... ??" "No, no peace of mind" "Are you saying'** Principle **'?" "Read the above message carefully" "Well ..." ** add! To override ** "?" "Oh, something"! "Do you mean you can change the settings if you put a mark?" "Seya, that street" "Forcibly save (overwrite) the edited contents even in the readonly file There is a command. "
"This is the command"
:w !sudo tee %
"It's very simple." "Seyaro" "**" sudo tee "for the file (%) to be opened now Forcibly overwrite the edited contents ** "Hey, is that so?" "Oh, that would require sudo privileges." "Seyana" "It's not the only thing" "If you force save, exit with **: q! **" "Kondeya" "In a blink of an eye" "Thank you very much ('ω`)"
→https://hacknote.jp/archives/12412/ →http://tm.root-n.com/unix:command:vim:readlonly_write
That's all for today. See you soon.
Recommended Posts