Generating Snippets with LuaSnip in Neovim
TL;DR When you have many variations of the same snippet, one option is to generate those with Lua code. The complete example is at the end. I’ve recently moved to LuaSnip as my snippets plugin for Neovim. When I first started, I sticked to the simplest features of LuaSnip, in particular the SnipMate-like syntax for snippets. But I have now started to explore the more distinctive features of LuaSnip, like Lua-defined snippets. It turns out that generating snippets with code can save tedious repetition. ...