Sweet! Well-expressed, and well-explored. It's easy to setup an interface that makes search a bit easier still, including showing you a list as you interactively filter history, with fzf, [gh-fzf].
Examples of what users use most frequently, the key-bindings.{bash,zsh} has history key binds [arch-fzf]. The developer, junegunn, writes about it more generally, and all the other fun ways you can apply it [dev-fzf].
For a few years, I wrote history files per shell-spawn, and loaded a batch of history from recent days to keep fresh what's in the immediately searchable history.
Nowadays, I've just offloaded that to atuin [atuin], which I install from brew or with cargo binstall. Much less configuration, and now get to quickly explicitly switch between history lists filtered as: global, host (you can sync among hosts), session, directory, -- I don't remember what filter session+ means.
I do like the idea of a search that uses what you've already typed instead of requiring you to type it again (as ctrl+r does, at least for me with zsh). I don't remember any specific cases off the top of my head but it feels like I've lost some time to that before.
Sweet! Well-expressed, and well-explored. It's easy to setup an interface that makes search a bit easier still, including showing you a list as you interactively filter history, with fzf, [gh-fzf].
Examples of what users use most frequently, the key-bindings.{bash,zsh} has history key binds [arch-fzf]. The developer, junegunn, writes about it more generally, and all the other fun ways you can apply it [dev-fzf].
For a few years, I wrote history files per shell-spawn, and loaded a batch of history from recent days to keep fresh what's in the immediately searchable history.
Nowadays, I've just offloaded that to atuin [atuin], which I install from brew or with cargo binstall. Much less configuration, and now get to quickly explicitly switch between history lists filtered as: global, host (you can sync among hosts), session, directory, -- I don't remember what filter session+ means.
- [gh-fzf]: https://github.com/junegunn/fzf#key-bindings-for-command-lin...
- [arch-fzf]: https://wiki.archlinux.org/title/Fzf
- [dev-fzf]: https://junegunn.github.io/fzf/shell-integration/
- [atuin]: https://atuin.sh/
This is useful on non-customized machines, but I always install fzf now, including the shell integrations like fuzzy history search bound to ctrl-r.
https://github.com/junegunn/fzf
I do like the idea of a search that uses what you've already typed instead of requiring you to type it again (as ctrl+r does, at least for me with zsh). I don't remember any specific cases off the top of my head but it feels like I've lost some time to that before.