3 ms·
One of my most life-changing bash configurations is having history-search-backward / history-search-forward bound to the up and down arrows. Put the following
by jashmenn 14y ago
One of my most life-changing bash configurations is having history-search-backward / history-search-forward bound to the up and down arrows.
Put the following in your ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
set show-all-if-ambiguous on
set completion-ignore-case on
Now if you type, say:
cat <UP ARROW>
You will cycle through commands in your history that start with the prefix "cat ".
- digisign 14y agoI use this with the fish shell, and it seems to do a better job of searching than the ^R in bash. Not sure of the difference, but I think bash only searches from the front of the string.