A set of preconfigured snippets for LaTeX for the snippet engine LuaSnip.
⚠️ Note: My implementation is based on VimTeX for a portion of the functionality; see the acknowledgements section for alternatives if VimTeX is not an option. I'm also hoping to adopt treesitter support later on, as mentioned a while ago in this issue.
luasnip-latex-snippets.mp4
I’ve created my share of smart snippets for LaTeX, and it might be nice to provide some solid defaults for people using snippets out of the box. Despite this, I would probably recommend others to make their own snippets if they can as the process is far more enjoyable and rewarding. But someone can tell me the same about creating a Neovim plugin while I’m sorely tempted to pay someone off to do the work for me because I really can’t deal with the development process, so do what makes you happy, I guess.
Use the package manager of your choice, or don't.
Lazy.nvim
{
"evesdropper/luasnip-latex-snippets.nvim",
},
Packer.nvim
use {
"evesdropper/luasnip-latex-snippets.nvim",
},
See snippets.md for the time being.
Of course, add more snippets. Ideally would also like to expand this to more languages, allow for better user experience in the future; feel free to make a PR to help contribute your own ideas.
Some similar snippet resources:
- friendly-snippets
- LuaSnip-snippets.nvim
- luasnip-latex-snippets.nvim (Same repo name, different author/snippets)
- Gilles Castel's LaTeX Snippets
Additionally, I would like to thank Max Mehta for bringing up the idea of creating this plugin and the creator of LuaSnip, L3MON4D3, for helping me debug some of the early stages of the plugin. There are also functions scattered throughout the code which are not made by me, so I've posted acknowledgements for those in the comments of the code.