1

I found this https://superuser.com/a/488158/458103 to make the ctrl+arrow to move the cursor forward and backward. Now how to make the shift+arrow select the current command words?

user
  • 537

1 Answers1

7

Execute cat and then press the desired keys. You'll see the escape sequences that get printed. E.g. the Right arrow without modifiers will probably produce ^[[C, with Ctrl modifier it probably gives you ^[[1;5C, whereas with Shift instead hopefully you'll get ^[[1;2C.

If you do, modify the config snippet that you linked accordingly (i.e. 2 instead of 5).

Note that the sequences might vary across terminal emulators, however, you're free to add them all to ~/.inputrc with the same action.

If you don't get anything printed in the terminal, chances are that you hit a shortcut key of the terminal emulator itself. E.g. for me Shift + Up or Down arrows don't produce anything (rather scroll by a line) in xfce4-terminal.

egmont
  • 2,566
  • 1
  • 15
  • 18