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.
Atuin (by @ellie@hachyderm.io) makes the history storage and management side much easier and portable, but could perhaps use a "smite mode" to make deletion interactively easier. The current interactive implementation prioritizes safety over expediency which is fine, but a "today I clean things" option could perhaps instead prioritize the other way around and enable one key delete w/ undo instead.
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.
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.
8 Comments
vort3@lemmy.ml · 27 pts · 1y
I comment the commands that I want and then use vim to remove ones without comments.
For example, I run:
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.grrgyle@slrpnk.net · 7 pts · 1y
We are same. I sometimes use comments as kind of tags, like
or
or sometimes I'll add
# worksat the end of a long string of attempts (usually involving dialing into a regexp), likeJinna@lemmy.blahaj.zone · 12 pts · 1y
Atuin (by @ellie@hachyderm.io) makes the history storage and management side much easier and portable, but could perhaps use a "smite mode" to make deletion interactively easier. The current interactive implementation prioritizes safety over expediency which is fine, but a "today I clean things" option could perhaps instead prioritize the other way around and enable one key delete w/ undo instead.
PotatoesFall@discuss.tchncs.de · 3 pts · 1y
Is this some sort of bash/zsh joke that I'm too fish to understand?
Okay I can see how curating could work. But if you're lazy like me, I recommend this:
https://github.com/PatrickF1/fzf.fish
karpintero@lemmy.world · 2 pts · 1y
I might try this. Normally would just pipe history into grep to search or scroll till I found the right command. Also
smiteis a great name for that function.elmicha@feddit.org · 10 pts · 1y
I use ctrl-r.
karpintero@lemmy.world · 2 pts · 1y
Excellent, thanks
utopiah@lemmy.ml · 2 pts · 1y
Right, I was starting to think "Oh yeah and maybe I could fzf history..." then wait, I already do that
reverse-i-searchthen edit. If I use that often enough, alias in ~/.bashrc or even function to make it composable.