Skip to content


LuaSnip is a snippet Engine for Neovim written in Lua.


It comes preinstalled with lazyvim. You can see the default configuration here.

Add your custom snippets

return {
    dependencies = {
      config = function()
        require("luasnip.loaders.from_lua").lazy_load({ paths = "./lua/snippets" })

And store your snippets in ./lua/snippets. You can write snippets in You have two main choices to write snippets: use SnipMate/VS Code snippets (easier) or write snippets in Lua (more complex but also more feature-rich).

If you want to learn to write lua snippets check these resources for new users.


Lazyvim comes with the friendly-snippets installed by default. It's good to have it cloned locally to browse the available ones.

Transform selected text

It can only be used on snippets that use TM_SELECTED_TEXT:

You'd have to

  • Select some text in visual mode
  • Hit whatever you set as store_selection_keys.
  • Expand that snippet.

It looks like the default binding for store_selection_keys is <Tab>. If it's not you can configure it with.