Commit graph

42 commits

Author SHA1 Message Date
Iordanis Petkakis
771089f692
fix(blink): make sure to use LazyVim.config.icons.kinds (#5668)
## Description
This blink
[commit](010d939e7f)
made a change, so that third party sources can provide their own
`item.kind_icon` and `item.kind_name`. The problem is that these icons
will take precedence over `config.kind_icons[kind]`, which LazyVim sets
[here](541b83276e/lua/lazyvim/plugins/extras/coding/blink.lua (L164-L164)).

I noticed that `blink-cmp-copilot` also started providing its own in the
items that it returns. I noticed this because I have the following in my
configuration `columns = { { "label", "label_description", gap = 1 }, {
"kind_icon", "kind" } }`. The icon that it uses is a smaller icon one
character long, which by default it will scale up and show normally like
the LazyVim icon. But when you put another component next to it (like
`kind`) in the `columns` field, then it shows the normal size of the
icon next to the `kind` and it looks kinda weird compared to the default
LazyVim icon.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots
Before (the default icon provided by `blink-cmp-copilot`)

![2025-02-22_02-17](https://github.com/user-attachments/assets/aa7da566-a577-4d32-822c-f2d891b3c047)

After (the LazyVim icon)

![2025-02-22_02-18](https://github.com/user-attachments/assets/342580a9-5a36-47fa-aad7-c139f2765d74)

<!-- 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-02-22 07:47:27 +01:00
Iordanis Petkakis
5b94baa1d2
fix(blink): remove unnecessary sources from cmdline (#5620)
## Description
Like Saghen already mentioned in the other PR, this
[commit](19f60a675e)
does a check based on the `enabled` field before adding sources, so it's
no longer needed to define it.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  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-02-16 08:05:52 +01:00
Iordanis Petkakis
e7f8e4faba
fix(blink): enable Neovim native mapping with <Tab> (#5617)
## Description
Another blink fix unfortunately. 

I noticed that native Neovim `<Tab>` completion didn't work after the
breaking commit.

I checked the commit and noticed it had a boolean `enabled` field, so I
thought maybe that would disable the blink cmdline since we already have
`sources = {}`, but it didn't work. Looking through the commit, I
stumbled upon this piece of
[code](93215d8034 (diff-f313d6f0270f6fed848f1cb7e62c82d3cfaf9b6c7e0072266908eeaf202f11d5R66-R68))
and it seems that it's only checked for applying the blink cmdline
mappings.

So, it seems both `enabled = false` (for Neovim native cmdline mapping)
and `sources = {}` are needed to have default Neovim cmdline experience.

PS: Apparently I don't know how to link from the commit the necessary
part of the commit, so I'm just referencing here the part of the code
[directly in the
file](426a605518/lua/blink/cmp/keymap/init.lua (L66-L70)).
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  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-02-15 23:47:17 +01:00
Iordanis Petkakis
b35015ac59
fix(blink): blink released new version, remove previous hack (#5616)
## Description
`blink.cmp` just made a new stable release. So, remove the hack and
define the option properly in `opts`.

If I knew it would make a release tonight, I'd definitely hold off my
recent PR.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  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-02-15 22:51:17 +01:00
Iordanis Petkakis
0458e46dcc
fix(blink): cmdline is now top-level on main branch (#5615)
## Description
This `blink.cmp`
[commit](93215d8034)
introduced a breaking change on main branch. `cmdline` is now top-level
and the option is `opts.cmdline.sources = {}`.

I also added a note to remove this hack when the next blink stable
release comes out, which should be greater than current 0.11.0 and just
do it normally in `opts` instead.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None.
<!--
  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-02-15 21:57:48 +01:00
Jorge Villalobos
b729e65318
refactor(blink): color swatch icon upstreamed (#5141)
## Description

I've upstreamed the block char vs. icon replacement for Tailwind colors
so we shouldn't need this here anymore. I've replaced it by extending
the default blink icons instead, just in case they introduce an icon
which isn't yet covered by Lazy's, it would still show up (unlikely, but
better, no?).

## Related Issue(s)

none

## Screenshots

none

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-01-17 10:00:30 +01:00
Igor Guerrero
857f330c21
fix(blink): remove compatibility with 0.7.6 release (#5212)
## Description

With the version update 5 mins ago, I got an error with this setting.

I'm not sure if removal is the correct way to fix this but it does runs
well on my local.

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-20 18:10:45 +01:00
Jorge Villalobos
2d7a04be47
refactor(blink): use upstream <Tab> keymap fn (#5130)
## Description

Replace re-defined super-tab `<Tab>` keymap function with the original
upstream one, so upstream fixes can propagate.

Related to #5127 

## Related Issue(s)

none

## Screenshots

none

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-16 20:29:13 +01:00
Folke Lemaitre
0f3a120186
fix(blink): remove show_on_insert_on_trigger_character since this has been fixed for {} and others 2024-12-16 20:28:01 +01:00
Folke Lemaitre
2cf3d234bf
fix(blink): don't trigger automatically on insert 2024-12-16 18:09:44 +01:00
Folke Lemaitre
5ea3cfa48e
fix(blink): add vim.snippet fixes to blink (was already added to cmp). Fixes #5067 2024-12-16 16:19:24 +01:00
Folke Lemaitre
22015e0b48
feat(blink): increase lazydev scores 2024-12-16 08:17:11 +01:00
Folke Lemaitre
89314cb2aa
fix(blink): allow overriding <Tab> key. Fixes #5095. Closes #5099 2024-12-15 18:44:24 +01:00
Folke Lemaitre
413566af59
fix(blink): super-tab and ai completions 2024-12-15 08:59:48 +01:00
Folke Lemaitre
3866fbcd40
feat(blink): add <c-y> to keymaps 2024-12-14 07:42:25 +01:00
Folke Lemaitre
5105f3c029
style(blink): make luals happy 2024-12-13 22:54:52 +01:00
Folke Lemaitre
b07378dde4
fix(blink): only override color symbol kind for blink 2024-12-13 22:54:38 +01:00
Folke Lemaitre
63eab6d9a5
fix(blink): compat with 0.7.6 2024-12-13 22:46:09 +01:00
Iordanis Petkakis
08a7f7e3f9
fix(blink): draw.treesitter expects table (#5044)
## Description
If you would like to enable more sources feel free. I just went with the
recommended setting in blink's default configuration. Although on their
repo the have it to empty table, but I assumed since you had it to
`true` you would at least want the `lsp` source.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)

<!--
  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.
2024-12-13 22:37:25 +01:00
Folke Lemaitre
1517ec9bb4
fix(blink): add backward compat for config 2024-12-13 21:08:48 +01:00
Jorge Villalobos
4488cb24f7
feat(blink): use block vs. icon for colors (#5037)
## Description

Replace use of icon for `Color` kind with block characters for
`blink.cmp` autocomplete items to make swatches more usable. This also
makes the `blink.cmp` built-in Tailwind integration better match
`nvim-cmp`.

**Note:** I didn't want to replace the default
`LazyVim.config.icons.kinds.Color` in case it's used by other plugins
(e.g. context), but didn't actually find any real uses, so perhaps that
could be done instead? Figured best to leave those untouched as they can
be more generically used as actual icons, and are not always guaranteed
to have custom highlights applied.

## Related Issue(s)

None.

## Screenshots

### Old

![Screenshot 2024-12-13 at 12 18
47](https://github.com/user-attachments/assets/1e73dac9-728d-47ba-8df1-4445b0143177)

### New

![Screenshot 2024-12-13 at 12 18
13](https://github.com/user-attachments/assets/1ff042f1-eda4-4a1b-afcd-658075666eeb)

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-13 20:18:25 +01:00
Folke Lemaitre
60b77045d5
fix(cmp): disable nvim-cmp/blink.cmp when needed 2024-12-13 19:56:03 +01:00
Folke Lemaitre
20eff4fc3f
fix(blink): disable cmdline integration for now since it doesn't work well with the enter keymap 2024-12-13 09:31:42 +01:00
Jorge Villalobos
29c4dea4e7
fix(blink): unset provider.kind (#5024)
## Description

Unsets `sources.providers[provider].kind` custom properties to pass
blink.cmp config validation.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

![Screenshot 2024-12-12 at 23 21
47](https://github.com/user-attachments/assets/21866a51-d0d5-4ee5-9cc3-3ce7f2eb6415)

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-13 07:25:42 +01:00
Folke Lemaitre
d95e530c02
fix(blink): remove unneeded code 2024-12-13 00:33:52 +01:00
Folke Lemaitre
29460318f3
fix(blink): unset sources.compat. Fixes #5016. Closes #5017 2024-12-13 00:25:53 +01:00
Folke Lemaitre
152f9d113f feat(cmp)!: moved nvim-cmp to extras and prefer blink.cmp on Neovim >= 0.10 as default completion engine 2024-12-12 13:47:29 +01:00
Stefan Boca
cee60a6d30
fix(blink): set kind to int, not string, if overriding (#4999)
## Description

when sorting completion results, blink compares kinds, which can result
in an error if the kind is a string

## Related Issue(s)

<!--
  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.
2024-12-12 06:29:08 +01:00
Folke Lemaitre
439340bd8a
fix(blink): config breaking changes. Fixes #4990 2024-12-11 10:57:09 +01:00
jyuan0
090ca75d3b
fix(blink): update config for latest changes (#4953)
## Description

Update the blink.cmp config for the latest changes.

Mainly fixing the experimental `auto_brackets` support (moved under the
`completion` key). The other changes are either the same as the
defaults, or commented out - they were simply updated to reflect the new
config format.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-12-05 08:46:15 +01:00
Stefan Boca
f841ecf6bd
feat(extras.ai): blink.cmp integration and kind overrides for menu drawing (#4942)
## Description

blink.cmp integration for codeium and copilot, and correct menu drawing
for codeium, copilot, and supermaven.

I've simplified the blink.cmp config a bit for these extras (especially
for copilot, which was extremely nested) by only including the blink.cmp
spec if vim.g.ai_cmp is true.

Multiple AI extras can now be enabled at the same time with blink.cmp.

blink.cmp ghost text is now always enabled. Although some ai plugins
always display virtual text, at worst it overlaps with blink's ghost
text and is not noticable.

Lastly, I can't test copilot because I don't have a subscription, nor do
I want to sign up for one, but it should work just as well as the
others.

## Screenshots

With Codeium:

![image](https://github.com/user-attachments/assets/1485ee3f-1cba-440f-8a82-ec69b4a3f473)

Multiple extras enabled at the same time:

![image](https://github.com/user-attachments/assets/4364ee45-d79b-4f97-a4c0-cf2a2b6433c6)

## Checklist

- [X] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-12-03 21:06:58 +01:00
Folke Lemaitre
0a9447c1b1
feat(blink): enabled treesitter highlighting 2024-12-02 19:43:08 +01:00
Folke Lemaitre
2263b94439
fix(blink): icons 2024-11-28 21:51:23 +01:00
Folke Lemaitre
efcba66a22
fix(blink): updated to config to reflect breaking changes 2024-11-28 07:39:30 +01:00
Folke Lemaitre
91a3c663a7
fix(blink): make sure blink.compat is setup correctly when used in extras 2024-11-24 22:03:43 +01:00
Zhou Fang
ffce089a9f
feat(blink): auto-enable catppuccin integration (#4799)
## Description

Auto enable `blink_cmp` integration in catppuccin if the theme plugin is
loaded.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

**Before**

![before](https://github.com/user-attachments/assets/918d5110-fd05-4468-9259-bf7164569521)

**After**

![after](https://github.com/user-attachments/assets/0d02d0c6-2b31-41cd-8b26-fbf74a86e498)


## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-16 07:32:07 +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
Folke Lemaitre
b841a1dfc3
fix(blink): remove draw="reversed" for now till new release 2024-11-07 22:52:38 +01:00
Folke Lemaitre
7ebed5349d
fix(blink): use release version 2024-11-03 15:26:45 +01:00
Folke Lemaitre
ec616a3cec
fix(blink): explicetely set version=false for now 2024-11-02 18:12:31 +01:00
Folke Lemaitre
28da1eb073
feat(blink): use vim.o.pumblend as winblend option for autocomplete menu in blink 2024-11-02 17:43:11 +01:00
Folke Lemaitre
ad52bf91bc
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
2024-11-02 09:54:55 +01:00