用vi修改文件,保存文件时,提示“readonly option is set”的解决方法

用vi修改文件,保存文件时,提示“readonly option is set”的解决方法

来源: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 来保存文件了。

转自:http://blog.csdn.net/longerandlonger/article/details/7266055

相关推荐

使用点评曝光小米(MI) 电视 挂架 非原装 32
365wm完美体育

使用点评曝光小米(MI) 电视 挂架 非原装 32

📅 08-30 👁️ 4369
闩字五行属什么
365赢了不让提款

闩字五行属什么

📅 01-09 👁️ 4462
如何轻松查看苹果备忘录中的字数?
365wm完美体育

如何轻松查看苹果备忘录中的字数?

📅 10-28 👁️ 200