1

I want to set the backspace key to the usual backward-delete-char in vi-command mode. In bash, ctrl-v + <backspace> outputs ^?.

I've tried the following in my ~/.inputrc file but find that <backspace> has not been remapped.

set editing-mode vi
set keymap vi-command
control-?: backward-delete-char
"^?": backward-delete-char
backspace: backward-delete-char
1
  • In emacs mode, bash (via readline) reads terminal settings and binds the terminal's erase character to backward-delete-char. I guess it does something similar in vi mode. I don't know how to work around this, it might take some source code reading (of both readline and bash, as a workaround might exist only via bash commands). Sep 8, 2022 at 7:00

1 Answer 1

1

The key name is Rubout. You probably want to bind it to vi-delete (x in normal mode) or vi-rubout (X in normal mode):

set keymap vi-command
Rubout: vi-delete

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .