3

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.

J-Win
  • 1,322
  • 16
  • 35
  • 2
    Are you actually putting in the SINGLE `^[` character? (In `vi`, you can put it in with `Ctrl-v[`. – Jack Jun 17 '17 at 22:40
  • Wow I would have never guessed that. Thanks! If you want to put that as the answer I would love to give you credit @Jack – J-Win Jun 18 '17 at 00:24

2 Answers2

3

Use vi to edit your .inputrc file, and then enter the ^[ character with Ctrl-v[ while in insert mode.

Jack
  • 5,801
  • 1
  • 15
  • 20
1

You may also write "\eh": backward-word (in .inputrc), which bind the key Alt-h.

Johnny Wong
  • 945
  • 9
  • 16