vim不允许退格

sim*_*ont 27 vim

文件foo有文字:

This| is a line.
Run Code Online (Sandbox Code Playgroud)

如果我将光标放在|,跳到insert模式,然后按backspace,没有任何反应.如果我输入内容,我可以删除我输入的内容,但只能删回插入开始的位置.例如,如果我将光标放在行的末尾并键入word,我可以删除word但不能删除.它左边的任何内容.

这很烦人.这是什么vim设置?

Dav*_*ain 55

说明

"退格"设置控制此行为.

从帮助页面:

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.
Run Code Online (Sandbox Code Playgroud)

改变退格行为

尝试将以下内容添加到您的.vimrc:

set backspace=indent,eol,start " backspace over everything in insert mode
Run Code Online (Sandbox Code Playgroud)

同一命令的简写版本:

set backspace=2
Run Code Online (Sandbox Code Playgroud)