Written by 7:52 pm Miscellania

Smart up and down on the command line

I bet everyone already knows this, but I just learned it and love it:

# put this in ~/.inputrc

# By default up/down are bound to previous-history
# and next-history respectively. The following does the
# same but gives the extra functionality where if you
# type any text (or more accurately, if there is any text
# between the start of the line and the cursor), the subset 
# of the history starting with that text is searched 
# Note to get rid of a line just Ctrl-C

"e[B": history-search-forward
"e[A": history-search-backward
 
# Include system wide settings which are ignored
# by default if one has their own .inputrc
$include /etc/inputrc
Close