Custom Snippets
Here is an example plugin specification to go inside your plugins folder which adds a custom path for it to load from. Be sure to read the comments in order to understand how to use this code for your environment.
Depending on the location of your configuration (typically ~/.config/nvim
), create a subdirectory named snippets
.
Custom snippets will be added to this snippets
directory. They will follow the vscode style as described in the documentation
This example Vue snippet is added as snippets/vue.json
:
In order for Luasnip to see the newly added snippet, it must be cataloged in snippets/package.json
:
To verify the newly added snippet works, create a new vue file with “.vue” extension and type any string represented in the snippet’s prefix; in this case, setup
. You can also use :LuaSnipListAvailable
to see a list of all snippets available.