4 ms·
For something more rustic, an .inputrc file with this: # history-search-backward / history-search-forward bound to the up and down arrows "\e[A": histo
by Grimburger 3y ago
For something more rustic, an .inputrc file with this:
# history-search-backward / history-search-forward bound to the up and down arrows
"\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
Will search through anything matching what you've already entered. Type something like "gr" and scroll up or down to see all your previously used grep commands.
Saw this long ago on here and it's on every machine I use now, can't live without it. Thankyou to whoever originally posted it.
- YoooThere 3y agoMagic! Thank you, now in my .bashrc files.
- bogwog 3y agoThis is something I can't live without either. I'd recommend people try this before trying to incorporate fzf, ctrl+r, etc into their workflows since it's simpler and probably covers 99% of your needs.
- BeetleB 3y agoWhile I agree one should have these keybindings, fzf + ctrl+r is a lot more powerful, and many a time I was on a system with those keybindings, and it would suck I did not have ctrl+r + fz. I'd say it covers perhaps 70-80% - not 99%.
- victor106 3y agodoes this work on a mac?
- syntaxing 3y agoJust tested, it does
- lamontcg 3y agoI just use this for quick history search of typically my last few commands in .zshrc: # tsch-style history search esc-n/esc-p bindkey '\ep' history-beginning-search-backward bindkey '\en' history-beginning-search-forward If I need substrings or searching for something further back in time I just use `history -99999 | rg` Tried ctrl-r bash style for about a month back when I was switching off of tcsh and hated it.
- deleted 3y ago[deleted]
- SushiHippie 3y agoHow does this differ from https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-history-substring-search ? Except that yours seems to be built-in and zsh-history-substring-search is ~800 lines of zsh