r/emacs•
nmorazotti

Resnippets.el - snippets with regex

Hello, folks! After spending more time than I should on the legendary post of Gilles on taking notes with Vim and Karthink answer, showing as much speed as Gilles, I've noticed that emacs doesn't have a snippet package that defaults by expanding on regex. Being necessary or not is a valid question, but now at least we have the option.

Introducing resnippets.el, the engine that expands based on suffix. You can replace fhat to \hat{f} automatically, fix typos like \\([a-zA-Z]+\\)cao to \1ção (matching cases and priority for cao -> cão, for example).

I'm aware that we have tempel, yasnippets, auto-expanding-snippets, abbrev and surely something else, but I did not find anything regexp-like.

It was entirely done with an LLM agent, which I suppose it's a big no-no to some, but in my testing, it does not slow down emacs at all.

It is auto-expanding only yet. I have not implemented a TAB completion. But it was made so I did not have to press a million tabs while writing math.

I'm accepting changes and critics! Check it out, test it out and give me your opinions! If you need a default set of some snippets to start it out, check here

Posted Feb 7, 2026, 11:08 PM UTC

828
Loading comments…