来源: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编辑器时遇到的文件被错误地标记为只读的问题。通常这不是文件权限问题,而是Vim内部的状态设置导致的。通过简单的步骤即可取消只读状态并保存文件。
1万+

被折叠的 条评论
为什么被折叠?



