开发者

Backspace behaviour in Vim

开发者 https://www.devze.com 2023-02-13 00:47 出处:网络
I\'ve got a problem with backspaces in Vim. If I hit backspace, the last character gets removed. I\'d like to get the Vi (not Vim) behaviour. In Vi backspace moves the cursor to the left, and if I typ

I've got a problem with backspaces in Vim. If I hit backspace, the last character gets removed. I'd like to get the Vi (not Vim) behaviour. In Vi backspace moves the cursor to the left, and if I type in something, the characters I backspaced get replaced.

I tried

:imap <BS> <Left>

It works in GVim (even if the backspaced chars don't get re开发者_运维百科placed), but it does not work in Vim. If this helps, I use the standard XTerm as my terminal emulator, and my $TERM environment variable is set to 'xterm'.


I believe you want Replace instead of Insert mode. Hitting the 'insert' key once will put you into Insert mode but hitting it twice will put you into Replace mode. That should give you the expected behaviour.

0

精彩评论

暂无评论...
验证码 换一张
取 消