utopiah 4 hours ago

Interesting but I have to admit as it's "One-line only" (great documentation BTW!) then I fail to see how it's better that `reverse-i-search` especially if one uses comments e.g. mycomment #comment does that or even plain aliases, e.g. command then history | tail -2 >> ~/.bashrc then a manual edition.

  • mnalli 4 hours ago

    I like your approach, it is even more minimal :)

    In general, I wanted the snippet store to be separate from the history, so that I could use the history as transient "working memory". Working with the history tends to get really messy after a while, at least for me.

    msm gives you a bit more than that. The description (comment) has to be one-line only, but the snippet can be multi-line. The selected snippet is injected in the command line, it does not replace the whole buffer. This can be useful e.g. if I have some saved configuration paths (I never remember them) or when working with process substitution commands. Integration with fzf: the preview will show the full multi-line output well formatted. Integration with bat: syntax highlighted output and preview. Multiple snippet stores: plain text files that you can edit with your editor.

    Aside from this, msm does not do much... it's just a 100 lines script.