feat(extras): blink (#4680)

## Description

Extra to use [blink.cmp](https://github.com/Saghen/blink.cmp) instead of
**nvim-cmp**.

## Todo

- [x] tokyonight suport
- [x] basic integration
- [ ] check / update all cmp sources
- [ ] copilot and others integration 
- [x] native lazydev source

## Limitations

There's no copilot source, so instead when enabling both blink and
copilot:
- blink ghost text is disabled
- copilot suggestions are enabled
- use `<tab>` to navigate snippets and accept copilot completions 

## Related Issue(s)

- https://github.com/LazyVim/LazyVim/discussions/4679
This commit is contained in:
Folke Lemaitre
2024-11-02 09:54:55 +01:00
committed by GitHub
parent a66b44a9fe
commit ad52bf91bc
5 changed files with 148 additions and 1 deletions

View File

@ -71,9 +71,17 @@ function M.add_missing_snippet_docs(window)
end
function M.visible()
---@module 'blink.cmp'
local blink = package.loaded["blink.cmp"]
if blink then
return blink.windows and blink.windows.autocomplete.win:is_open()
end
---@module 'cmp'
local cmp = package.loaded["cmp"]
return cmp and cmp.core.view:visible()
if cmp then
return cmp.core.view:visible()
end
return false
end
-- This is a better implementation of `cmp.confirm`: