- cross-posted to:
- linux@programming.dev
- cross-posted to:
- linux@programming.dev
I comment the commands that I want and then use vim to remove ones without comments.
For example, I run:
longandannoyingcommand -f1 -f2 -f3 # keep, does something useful
Usually comment explains what the command does so I can find it by description using fzf history search. And then you can easily find all lines that contain (or do not contain “
# keep
”) in your history to remove or keep.I might try this. Normally would just pipe history into grep to search or scroll till I found the right command. Also
smite
is a great name for that function.I use ctrl-r.
Excellent, thanks
Right, I was starting to think “Oh yeah and maybe I could fzf history…” then wait, I already do that
reverse-i-search
then edit. If I use that often enough, alias in ~/.bashrc or even function to make it composable.