Skip to content

Commit

Permalink
feat: add luasnip configuration recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
max397574 committed Nov 12, 2024
1 parent 2fabb32 commit 61f564c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/configuration_recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,48 @@ config = function()
end)
end,
```

## Common Configurations

### Luasnip and friendly-snippets

- Optional: Install
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
- Install [LuaSnip](https://github.com/L3MON4D3/LuaSnip)
- Install [care-cmp](https://github.com/max397574/care-cmp)
- Install [cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip)

<details>
<summary>Lazy.nvim Example</summary>

```lua
{
"max397574/care.nvim",
dependencies = {
"max397574/care-cmp",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"L3MON4D3/LuaSnip",
},
config = function()
...
end
}
```

</details>

Then you can use the following configuration to use luasnip for snippet
completion and to load the friendly-snippets snippets.

```lua
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("care").setup({
snippet_expansion = function(body)
require("luasnip").lsp_expand(body)
end,
...
})
end
```

0 comments on commit 61f564c

Please sign in to comment.