美文网首页
用vim修改文件时,解除只读状态的解决方案

用vim修改文件时,解除只读状态的解决方案

作者: 筱平哥哥 | 来源:发表于2020-10-13 09:59 被阅读0次

    来源:http://superuser.com/questions/300500/ubuntu-unable-to-edit-bashrc-file-because-of-readonly

    This is a vim issue, not a file permission issue. If you did not have read permission on the file, you'd see a "Permission denied" error.

    Do you invoke vi/vim with the -R option? Are you calling view instead of vi or vim? Do you have set readonly in your .vimrc or in a file in ~/.vim/ftplugin?

    In vim you can enter :set noreadonly to unset the readonly flag.

    具体解决步骤:

    1.按Esc键,进入命令模式

    2.输入 :set noreadonly

    3.然后就可以输入 :wq 来保存文件了。

    相关文章

      网友评论

          本文标题:用vim修改文件时,解除只读状态的解决方案

          本文链接:https://www.haomeiwen.com/subject/vcampktx.html