This is easily fixed. Enter the below in ~/.vimrc
†Ensure correct delete/backspace mapping, even from ssh
set t_kb=^?
set t_kD=^H
set backspace=indent,eol,start
updated: thanks to Stuart.
This is easily fixed. Enter the below in ~/.vimrc
†Ensure correct delete/backspace mapping, even from ssh
set t_kb=^?
set t_kD=^H
set backspace=indent,eol,start
updated: thanks to Stuart.
Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.
Horaayy..there are 5 comment(s) for me so far ;)
Or, for the current way to perform the fourth action in versions of vim from 5.5 onwards:
:set backspace=indent,eol,start
(Note that this allows backspacing over autoindents and line breaks, allows deletion from before the point where the current insertion commenced)
… so it’s not required to get backspace/delete working properly - but it’s certainly nice to have!
… and actually, it’s the wrong way around!
Firstly, the first line makes ^? and ^H indistinguishable, so there’s no way to tell backspace (delete-left) from delete (delete-right). This is obviously wrong, and so should be omitted.
The second line maps the backspace function to delete, the third line maps the delete function to backspace!
So the correct entries in .vimrc are:
” Ensure correct delete/backspace mapping, even from ssh
set t_kb=^?
set t_kD=^H
set backspace=indent,eol,start
… noting that “^?” is input by typing ctrl+v, then backspace, and “^H” from ctrl+v then delete. Depending on the language settings and unicode mode on either end of an ssh connection, this may not appear as ^H, you may see something similar to “^[[3~”.
Yay to fully unicode OSs <sigh>
(Everyone should try Plan 9 at least once ;)
Stuart, good comments as always! ;) However, the above settings work 100% for me in both SSH and local xterm’s.
This didn’t work for me. I’ve still got a forward delete for a backspace key. What gives?
Thank you so much! I’ve been sitting here for a good 20mins trying to figure out what was going on, as opposed to starting my assignment.
Thanks again. Jerome