关于linux:用vim修改文件时解除只读状态的解决方案

102次阅读

共计 455 个字符,预计需要花费 2 分钟才能阅读完成。

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

正文完
 0