Created
November 14, 2013 23:12
-
-
Save marr/7476095 to your computer and use it in GitHub Desktop.
Make up and down arrows search through history of partially typed commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bind the up arrow to history search, instead of history step | |
"\e[A": history-search-backward | |
# And the reverse (down) | |
"\e[B": history-search-forward |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about using ctrl-up & ctrl-down instead? Like:
"\e[1;5A": history-search-backward
"\e[1;5B": history-search-forward
or alt-up & alt-down:
"\e[1;3A": history-search-backward
"\e[1;3B": history-search-forward
or shift-up & shift-down:
"\e[1;2A": history-search-backward
"\e[1;2B": history-search-forward
For combinations of modifiers: use "\e[1;$(( 1 + (shift?1:0) + (alt?2:0) + (ctrl?4:0) ))A" (or "...B" of course).