4 ms·
One thing I wish I knew how to do -- presuming it's possible -- is constraining the reverse/forward history search. Say I know I'm looking for a grep command, I
by Xophmeister 4y ago
One thing I wish I knew how to do -- presuming it's possible -- is constraining the reverse/forward history search. Say I know I'm looking for a grep command, I'll do `C-r grep`, but then I want to look through that subset of results for another string (e.g., the pattern, or maybe another part of a pipeline that I half-remember). AFAIK, reverse/forward history search is just an exact string match...and remembering exact strings is hard.
- loloquwowndueo 4y agoFzf can probably help here : https://github.com/junegunn/fzf https://github.com/junegunn/fzf
- deleted 4y ago[deleted]
- jlokier 4y agoI'd use "history | grep ..." at that point, if I can't remember an old command. Possibly "history | grep ... | less" and finish searching inside less.
- d4rkp4ttern 4y agoI was doing history grep too until someone on HN told me about hstr: https://github.com/dvorka/hstr https://github.com/dvorka/hstr
- uneekname 4y agoAnother similar tool that may be of interest is mcfly https://github.com/cantino/mcfly https://github.com/cantino/mcfly
- BeetleB 4y agoAs another commenter said, fzf is the way to go.