每当我在VIM中输入backspace时,编辑器就会插入^?。我已经编辑了.vimrc,使其具有set backspace=indent,eol,start,但它没有工作。set backspace=2也不起作用。
我读到你需要编辑/etc/X11/.但是文件夹和文件不存在。
这不是一个重复,因为我已经尝试了以前提出的解决方案,但它没有工作。
发布于 2016-08-30 22:01:44
编辑/etc/X11/app-defaults/XTerm是可能的,但是如果您没有该文件,那么您可能使用的是不同的终端。
问题不在于您在vim中使用的设置,而是终端描述和终端对于"backspace“发送的内容不一致。
通常"backspace“与stty erase值相同,您可以使用stty -a看到这个值,例如,
~ (101) stty -a
speed 38400 baud; rows 40; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke如果stty显示^H并且终端实际发送^? (ASCII,或127),那么vim可能会感到困惑。
在vim的帮助文件中,它声称如果你
:fixdel在您的.vimrc中,它能够做正确的事情:
:fix[del] Set the value of 't_kD':
't_kb' is 't_kD' becomes ~
CTRL-? CTRL-H
not CTRL-? CTRL-?
(CTRL-? is 0177 octal, 0x7f hex) {not in Vi}
If your delete key terminal code is wrong, but the
code for backspace is alright, you can put this in
your .vimrc:
:fixdel
This works no matter what the actual code for
backspace is. https://unix.stackexchange.com/questions/306667
复制相似问题