Skip to content

Commit

Permalink
fix(snippets): update custom snippets instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jan 11, 2024
1 parent c5cc26d commit 239513c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/content/docs/recipes/snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ return {
"L3MON4D3/LuaSnip",
config = function(plugin, opts)
-- include the default astronvim config that calls the setup call
require("plugins.configs.luasnip")(plugin, opts)
require("astronvim.plugins.configs.luasnip")(plugin, opts)
-- load snippets paths
require("luasnip.loaders.from_vscode").lazy_load({
paths = { vim.fn.stdpath("data") .. "/lua/snippets" },
paths = { vim.fn.stdpath("config") .. "/snippets" },
})
end,
}
```

Depending on the location of your configuration (typically `~/.config/nvim`), create a subdirectory named `snippets` in your `lua/` folder.
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](https://github.com/l3mon4d3/luasnip/blob/master/doc.md#vscode-snippets-loader)

This example Vue snippet is added as `snippets/vue.json`:
Expand Down Expand Up @@ -51,7 +51,7 @@ In order for Luasnip to see the newly added snippet, it must be cataloged in `sn

```json title="snippets/package.json"
{
"name": "user snippets",
"name": "user_snippets",
"engines": {
"vscode": "^1.11.0"
},
Expand Down

0 comments on commit 239513c

Please sign in to comment.