Show HN: Ssort – I got sick and vibe coded a stream priority sorter
github.comHi HN,
I've been coding for over 20 years, and I've always had this specific annoyance: when I grep or rg through a codebase, the definitions or declarations I actually want to see are often buried in the middle of the stream.
I got tired of crafting magic regex sequences to find them, so when I came down with the (actual) flu this week and needed to occupy my brain, I built ssort.
It's a CLI tool that buffers input and bubbles specific matches (like "struct", "class", "func") to the top while flushing the rest later. It was partially "vibe coded" with Gemini during (ongoing) recovery.
It's simple, written in Go, and finally solves my search ordering problem. Hope you find it useful. Layperson question: how does this differ from, say, piping something to fzf; and what advantages does it have over that? Good question - main thing is that it's saving time on repeatable searches and optimize search. I was working with Elixir without ability to use LSP and so, my flow often looked like this: With config file I can do a simple
Only to find that someone made a "def_instruction" and it's there. I didn't want to filter our, I just wanted to... sort. > rg "defp|def\b|def_rule|def_helper" . | rg "something"
This can be solved by working LSP though, what working LSP can't solve though is: > rg "something" | ssort ~/ssort/elixir_methods
> # or if I use it often
> alias ssort-elixirm "ssort ~/ssort/elixir_methods"
> rg "something | ssort-elixirm
But (given as it looks like it was buried) it's a microoptimization for CLI search freaks ;) > rg "impl" | ssort-elixirm | ssort -f MyCompany