3 ms·
The up arrow to go back in history matching the partial command I typed is has become essential to me. I feel lost without it, more than the tab completion.
by rnhmjoj 12y ago
The up arrow to go back in history matching the partial command I typed is has become essential to me.
I feel lost without it, more than the tab completion.
- barrkel 12y agoI use C-r and C-s in bash, for incremental searching backwards and forwards. Takes less time to type these than reach across to the up and down arrow keys. Mind to stty stop undef to stop C-s from freezing your terminal, of course. Zsh would probably be worth using, except for the fact that bash is almost everywhere, and I already know it very well. It's a tough one to call.
- ealloc 12y agoYou can do it in bash too. I have this in my bashrc: bind '"^[[1;5A": history-search-backward' bind '"^[[1;5B": history-search-forward' where ^[ is the escape character. This way, crtl-up goes to previous partial match (and up goes to last command as usual). I use it all the time.
- rnhmjoj 12y agoI didn't think that was possibile. Thank you.
- jackalope 12y agoI have this to use the arrow keys without any modifier: # Use up/down arrows to search on partially typed command bind '"\e[A"':history-search-backward bind '"\e[B"':history-search-forward Just type the first letter(s) and use the up/down arrows to scroll through the filtered command history. Incredibly convenient.
- peter12355 12y agoYou should check out https://github.com/tymm/directory-history https://github.com/tymm/directory-history then. It makes your history matching sensitive to the directory you are in. That means that commands will show up first which were typed in the directory you are in. I don't want to miss this plugin and can't really understand why not everyone wants it. I guess I am a little biased though since I wrote that plugin ;)