Packaged Neovim Snippets
I don’t like code completions—they are at best distracting to my work and at worst cause problems because of over-eager completion preventing me from seeing the rest of my code, or breaking my return key (though this last one is probably more a problem with my config than anything else). I do like code snippets, because I can define the completions and write notes for myself. Over the past year or so, I accumulated a bunch of them from different books and website and things that I’ve made and reused.
Previously, I had a hand-maintained set of VSCode-style json files, which are compatible with the luasnip neovim plugin. Problem: now I have a library of json files. To solve this, I wrote up a python script to convert markdown files to json files, which allowed me to store my snippets as markdown instead of json. Then I stuck a Makefile in the repo to streamline updates. My library lives at eweix/snippets, and the scripts may be useful if anyone else wants to build something like this. I had a brief period where I was trying to get it to work with zed—which has the best vim emulation I’ve seen in a non-vim editor—but ultimately gave up, since I have neither the time nor inclination right now to learn its API or cargo packaging.
Posted by Elliott Weix.