I use bog-standard zsh without any plugins or any of the fancy stuff, but one of the most useful tricks I use is to leverage interactive comments. If I have a long command I know I run will frequently, I 'tag' them at the end by a shell comment[1].
So for example, I have one that I use to run software updates:
I have a similar one without the `--restart` option that I tag with `:norestart` instead, but you get the idea—I put related commands under a common term.
Then I can just use the ctrl-r builtin keybinding, type `:system` and cycle through system related commands, or go exactly to the command I want. The beauty of this is that it also works in bash and systems I remote into (which I frequently need to do at work), without any extra plugins required.
[1]: interactive comments are disabled by default in zsh, but can be enabled with `setopt interactive_comments`
Interesting approach. Im so lazy I would just create a alias with the commands initials so "sur" but I guess that can get confusing if there are too many.
For sure. Personally, I avoid shortened aliases like that. I regularly need to use barebones systems so I wouldn't like something like "ll" (`ls -l`) or "gst" (`git status`) becoming muscle memory. Most of my aliases I do define are proper english words.
I use Atuin and like it a lot, and sync history across hosts.
However, the fuzzy search in Atuin is worse than fzf, which was a downgrade. It just has less effective heuristics/scoring, e.g. it might find the individual letters of a short command scattered in a command that had a long base64 input or something.
this runs before commands, not after the whole command line (before prompt is displayed).
my personal bash history tweak suit is based on this.
with a load of complexity of course, because the DEBUG trap is also triggered before each PROMPT_COMMAND commands and on every simple command within the issued command line.
so the above example would record each command of a pipeline separately.
Usually it does de-dupe any submission with "significant attention", but I'm not sure what the threshold for that is.
I'd think the submissions from two days ago (206 points, 93 comments) would have qualified. (It's the exact same URL so that's not why it wasn't de-duped either.)
Yes, he can manually merge duplicate submissions and their comments.
But there's times when I've submitted items that are dupes and it just takes me to the recent submission and adds an upvote. Now here's something weird: I just tested this by submitting the URL from this submission with the same title and it immediately took me to the discussion from two days ago.
Have been using Atuin for a couple (few?) years, it's great! How many others are using it too? I'm curious what everyone's tool of choice for shell search is!
happy user here. atuin coupled with z has made it so much easier to be productive across multiple projects (especially less frequently accessed ones). just "z project" and then Ctrl+r twice to see the most recently used commands in that directory.
An unfortunate problem with using awk: there are three different versions of awk, and it is frighteningly easy to use a feature that exists on one but not other.
(source: I have written unit tests against different versions of awk. That was... unpleasant.)
So for example, I have one that I use to run software updates:
I have a similar one without the `--restart` option that I tag with `:norestart` instead, but you get the idea—I put related commands under a common term.Then I can just use the ctrl-r builtin keybinding, type `:system` and cycle through system related commands, or go exactly to the command I want. The beauty of this is that it also works in bash and systems I remote into (which I frequently need to do at work), without any extra plugins required.
[1]: interactive comments are disabled by default in zsh, but can be enabled with `setopt interactive_comments`
reply