LuaSnip is a snippet engine for Neovim written in Lua. It expands tab stops, transforms text, and loads VS Code, SnipMate, or native Lua snippets.
Overview
LuaSnip plugs into Neovim to provide snippet expansion with tab stops, Lua-driven transformations, conditional expansion, nested snippets, choices, dynamic snippets, regex triggers, and autotriggered snippets. It can parse LSP-style snippets directly in Lua or load VS Code packages and SnipMate collections.
It requires Neovim 0.9 or newer and optionally jsregexp for LSP snippet transformations. Users install via common Neovim plugin managers, map keys for expand, jump forward and back, and cycle choices, and can integrate with nvim-cmp for completion-driven expansion.
Loaders pull snippets from plugin directories, custom VS Code folders with package.json, SnipMate-style trees, or Lua files via add_snippets or the Lua loader with hot reload. Documentation and example Lua snippets cover advanced nodes such as functionNode, dynamicNode, choiceNode, and restoreNode.
Most day-to-day snippets can stay in LSP or SnipMate syntax; richer behavior uses Lua definitions inspired by vsnip.
Key features
- Tabstop and choice nodes
- Lua snippet transformations
- VS Code snippet packages
- SnipMate format loading
- Regex and autotrigger snippets
- Nested and dynamic snippets
- LSP snippet parsing
- Treesitter filetype detection
Use cases
- Neovim coding snippets
- Shared team snippet packs
- Complex templated boilerplate
- nvim-cmp completion snippets