我正在使用 vim。我使用
创建了一个新的 cpp 文件vim xyz.cpp
打开文件后,我添加了一些基本的包含和注释。然后我关闭它(:wq!)并重新打开它,却发现即使在按i(用于插入)之后,我也无法删除/编辑以前编写的命令,尽管它进入插入模式并且我可以向文件添加新文本。我必须说,当我不处于插入模式时,我可以通过按 x 删除单个字符。但这并不能解决我的问题。
我检查了文件权限,它显示 -rwxrwxrwx,所以我认为权限不是问题。以前有人遇到过这个问题吗?任何形式的帮助将不胜感激。
谢谢
最佳答案
:help 'backspace'
是你的 friend
Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
mode. This is a list of items, separated by commas. Each item allows
a way to backspace over something:
value effect ~
indent allow backspacing over autoindent
eol allow backspacing over line breaks (join lines)
start allow backspacing over the start of insert; CTRL-W and CTRL-U
stop once at the start of insert.
When the value is empty, Vi compatible backspacing is used.
尝试将其设置为
set backspace=indent,eol,start
关于unix - 无法在vim中修改重新打开的文件(文件权限不是问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6527111/