perreal's answer tells you how to alter the Linux console to match vim's current settings, but you also have the option of altering vim's settings to match the Linux console. The relevant options are t_kb
and t_kD
to tell vim what characters the terminal generates when you press the Backspace and Delete keys respectively. Query the current settings first so you can see what they're set to:
:set t_kb? t_kD?
and then change them like this:
:set t_kb=XXX t_kD=XXX
In place of the XXX's you should type Ctrl-V followed by Backspace for the first one and Ctrl-V followed by Del for the second one.
There's another question you could be asking, about why these settings weren't properly detected in the first place. If you're interested in investigating that, we'll need to see your $TERM
variable and the corresponding terminfo database entry, which you can get with:
echo $TERM
infocmp | egrep 'kdch1|kbs'