I'm trying to make the following bindings in my ~/.inputrc
:
(Ctrl+Del): kill-word
(Ctrl+Backspace): backward-kill-word
(Ctrl+forward arrow): forward-word
(Ctrl+back arrow): backward-word
(Home): beginning-of-line
(End): end-of-line
What actual key sequence notations should I use for those?
Best Answer
Something like this:
Depending on the terminal settings and whether you're using
screen
,xterm
would send those variations for Home and End, while the Control modified-cursor keys send a consistent value. You could change that (withxterm
: other terminals generally not).The control/Del and control/backspace probably won't work, unless by Del you mean the lower-left key on the 6-key editing keypad. For xterm, that sends
"\e[3;5~"
.With putty, you have few choices for "ctrlarrows" because it uses the control-modifier to switch between the normal and application modes of the cursor keys. That is, you'd toggle between "\e[C" (normal) and "\eOC" (application). Also, it's possible to change the home/end (to what putty's developers called "rxvt") to get the "\e[H" mentioned above.
Further reading: