Reputation: 1502
I'm using Cygwin and followed the post at In bash, how do I bind a function key to a command?
I used Ctrl-v
to determine the mapping of some keys (e.g. alt-h
is ^[h
).
As a result, I put "^[h":backward-word
in my .inputrc
but it doesn't work.
Other mappings for control-keys work, but not for alt-keys.
Upvotes: 5
Views: 1422
Reputation: 975
You may also write "\eh": backward-word
(in .inputrc), which bind the key Alt-h
.
Upvotes: 2
Reputation: 6198
Use vi
to edit your .inputrc
file, and then enter the ^[
character with Ctrl-v[
while in insert mode.
Upvotes: 4