文件foo具有文本:
foo
This| is a line.
字符串如果我把光标放在|上,跳到insert模式,然后按退格键,什么都不会发生。如果我输入了什么,我可以删除我输入的东西,但只能回到插入开始的地方。例如,如果我把光标放在行尾,然后输入word,我可以删除word,但不能删除.或它左边的任何东西。这是相当恼人的。什么vim设置这样做?
|
insert
word
.
vim
r7xajy2e1#
解释说明“退格键”设置控制此行为。从帮助页面:
Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insertmode. This is a list of items, separated by commas. Each item allowsa way to backspace over something:value effectindent allow backspacing over autoindenteol 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.
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.
字符串
尝试将以下内容添加到.vimrc:
.vimrc
set backspace=indent,eol,start " backspace over everything in insert mode
型同一命令的简写版本:
set backspace=2
型
ahy6op9u2#
如果你使用vim:
vim ~/.vimrc
字符串如果您使用vi:
vi
vi ~/.exrc
型然后将这一行添加到文件的顶部:
set nocompatible
型保存文件,这应该可以修复它
2条答案
按热度按时间r7xajy2e1#
解释说明
“退格键”设置控制此行为。
从帮助页面:
字符串
更改退格键行为
尝试将以下内容添加到
.vimrc
:型
同一命令的简写版本:
型
ahy6op9u2#
如果你使用
vim
:字符串
如果您使用
vi
:型
然后将这一行添加到文件的顶部:
型
保存文件,这应该可以修复它