Folke Lemaitre
8d2d9a9bd9
fix(blink): added new luasnip preset
2025-01-08 07:41:44 +01:00
Iordanis Petkakis
05c3447558
fix(luasnip): correctly remove duplicate snippets ( #5214 )
...
## Description
Remove `snippets` from `opts.sources.default` when Luasnip is enabled to
not get duplicate snippets.
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
## Related Issue(s)
Fixes #5210
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Checklist
- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md )
guidelines.
2025-01-07 12:04:17 +01:00
Folke Lemaitre
86de9c9e44
fix(luasnip): use blink's luasnip source. Closes #5211
2024-12-20 18:35:22 +01:00
Folke Lemaitre
ef9102677f
feat(keymaps): unlink luasnip on esc
2024-12-15 11:46:24 +01:00
Folke Lemaitre
a9a273d041
fix: fqn for nvim-cmp
2024-12-12 14:45:47 +01:00
Valentin Degenne
8c79ab601a
feat(luasnip): add default user snippet location ( #4987 )
...
## Description
Loads snippets in user directories if it exists.
## Checklist
- [X] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md )
guidelines.
2024-12-11 11:13:57 +01:00
Folke Lemaitre
7bb954fd1d
fix(blink): fixed luasnip completions for blink
2024-11-28 07:39:30 +01:00
Folke Lemaitre
fbf881f80b
feat(ai): better completion/suggestions of AI engines ( #4752 )
...
## Description
The whole completion / snippets / AI is very tricky:
- multiple snippet engines
- native snippets on > 0.11 set their own keymaps, but not on 0.10
- multiple completion engines, like `nvim-cmp` and `blink.cmp`
- multiple ai completion engines that have a different API
- user's preference of showing ai suggestions as completion or not
- none of the ai completion engines currently set undo points, which is
bad
Solution:
- [x] added `LazyVim.cmp.actions`, where snippet engines and ai engines
can register their action.
- [x] an action returns `true` if it succeeded, or `false|nil` otherwise
- [x] in a completion engine, we then try running multiple actions and
use the fallback if needed
- [x] so `<tab>` runs `{"snippet_forward", "ai_accept", "fallback"}`
- [x] added `vim.g.ai_cmp`. When `true` we try to integrate the AI
source in the completion engine.
- [x] when `false`, `<tab>` should be used to insert the AI suggestion
- [x] when `false`, the completion engine's ghost text is disabled
- [x] luasnip support for blink (only works with blink `main`)
- [x] create undo points when accepting AI suggestions
## Test Matrix
| completion | snippets | ai | ai_cmp | tested? |
|--------------|--------------|-------------|--------|---------|
| nvim-cmp | native | copilot | true | ✅ |
| nvim-cmp | native | copilot | false | ✅ |
| nvim-cmp | native | codeium | true | ✅ |
| nvim-cmp | native | codeium | false | ✅ |
| nvim-cmp | luasnip | copilot | true | ✅ |
| nvim-cmp | luasnip | copilot | false | ✅ |
| nvim-cmp | luasnip | codeium | true | ✅ |
| nvim-cmp | luasnip | codeium | false | ✅ |
| blink.cmp | native | copilot | true | ✅ |
| blink.cmp | native | copilot | false | ✅ |
| blink.cmp | native | codeium | true | ✅ |
| blink.cmp | native | codeium | false | ✅ |
| blink.cmp | luasnip | copilot | true | ✅ |
| blink.cmp | luasnip | copilot | false | ✅ |
| blink.cmp | luasnip | codeium | true | ✅ |
| blink.cmp | luasnip | codeium | false | ✅ |
## Related Issue(s)
- [ ] Closes #4702
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Checklist
- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md )
guidelines.
2024-11-11 10:50:57 +01:00
Lucas
e80ed322a7
perf(luasnip): luasnip wasn't lazyloaded ( #4032 )
...
## Description
this makes the extra luasnip lazy load at the same time as nvim cmp.
just putting `lazy = true` works because `nvim-cmp` when being loaded
with `InsertEnter` also load `cmp-luasnip`, which itself load `LUASNIP`.
you can see the problem in the following discussion
https://github.com/LazyVim/LazyVim/discussions/3966 where luasnip was
not lazy loaded when starting lazyvim. This was also loading nvim-cmp
and all its dep when starting lazyvim, which negatively impacted
performance.
## Related Issue(s)
https://github.com/LazyVim/LazyVim/discussions/3966
## Checklist
- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md )
guidelines.
2024-07-14 18:19:28 +02:00
Folke Lemaitre
aa059e0d49
fix(luasnip): disable nvim-snippets when luasnip is enabled. Fixes #3547
2024-06-09 07:37:45 +02:00
Folke Lemaitre
da7b7738eb
fix(luasnip): move mappings to cmp spec so that they dont conflict with native snippets
2024-06-02 18:43:44 +02:00
Folke Lemaitre
3c4ebd522e
feat(coding)!: native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back
2024-05-16 21:25:51 +02:00