Linux vim/vi下backspace(退格键)出现^? 或^H

当次删除操作,可以用【ctrl+w】以词为单位删除。一劳永逸的解决办法需按下面进行,二选一。

vim/vi下退格键出现^? (bash下)

编辑 .bash_profile 文件,添加一行 stty erase ^? 到最后。执行如下:

vi ~/.bash_profile
stty erase ^?

vim/vi下退格键出现^H(csh下)

编辑 .cshrc 文件,添加一行 stty erase ^H 到最后。执行如下:

vi ~/.cshrc
stty erase ^H

 

----------------------------------------------------------------------------------------

p.s.:bash下 检查修改是否成功,输入命令:

stty -a

输出为:

speed 38400 baud; rows 50; columns 126; line = 0;
intr = ^C; quit = ^\; erase = ^?; 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 -cdtrdsr
-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

发现值 erase = ^?; 已经修改成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值