Commit graph

136 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
abeldekat
f2f2aea672
feat(snippets): mini.snippets standalone and blink.resubscribe (#5507)
## Description


When using blink.cmp and mini.snippets, the same problem regarding
outdated completion items as solved in
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp/pull/2126) can arise.

[This](https://github.com/Saghen/blink.cmp/pull/1035) PR has been
included into main.
When the PR is included into the next stable release, this PR can be
merged.
Current blink release: 0.11.0


## Checklist

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

Co-authored-by: abeldekat <abel@nomail.com>
2025-02-16 09:06:35 +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
Roland Kaminski
5788b9d1e0
feat(extras): setup neogen and mini.snippets integration (#5594)
## Description

Configure neogen and mini.snippets integration.

See also #5593.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2025-02-14 17:32:33 +01:00
Folke Lemaitre
121a2e27ef
fix(extras): disable import handling when loading :LazyExtras + changed some recommendations 2025-02-10 23:27:24 +01:00
abeldekat
4a81a370d7
feat(snippets): mini.snippets is out of beta (#5505)
## Description

mini.snippets is out of beta, so I adjusted the description for the
extra accordingly


## Checklist

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

---------

Co-authored-by: abeldekat <abel@nomail.com>
2025-01-31 17:11:26 +01:00
Iordanis Petkakis
0350934d56
fix(luasnip): schedule jump to be compatible with blink, nvim-cmp still works after change (#5470)
## Description
Schedule `jump` in Luasnip `snippet_forward`, so that it doesn't get
stuck before the last placeholder.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
Fixes #5469
<!--
  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-28 09:19:01 +01:00
abeldekat
8b4e6ff70d
feat(snippets): an extra for mini.snippets (#5274)
## Description

Mini.snippets, a plugin to manage and expand snippets, is currently in
[beta](https://github.com/echasnovski/mini.nvim/issues/1428).

I think the plugin is a very interesting alternative to `luasnip`.

The following `lazydoc` will be added:

```lua
if lazyvim_docs then
  -- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows
  -- Motivation: Less clutter in completion windows and a more direct usage of snippits
  vim.g.lazyvim_mini_snippets_in_completion = true

  -- Using default mini.snippets, completion suggestions might appear directly after inserting a snippet
  -- This extra prevents that from happening.
  -- Motivation: A better display of the current snippet.
  -- Also, those completions do not appear when using luasnip or native snippets
  --
  -- Set to `false` to enable completion suggestions directly after inserting a snippet
  vim.g.lazyvim_mini_snippets_override_expand_insert = true

  -- NOTE: Please also read:
  -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand
  -- :h MiniSnippets-session

  -- Example override for your own config:
  --[[
  return {
    {
      "echasnovski/mini.snippets",
      opts = function(_, opts)
        -- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang()
        -- This provides a sensible quickstart, integrating with friendly-snippets
        -- and your own language-specific snippets
        --
        -- In order to change opts.snippets, replace the entire table inside your own opts

        local snippets, config_path = require("mini.snippets"), vim.fn.stdpath("config")

        opts.snippets = { -- override opts.snippets provided by extra...
          -- Load custom file with global snippets first (order matters)
          snippets.gen_loader.from_file(config_path .. "/snippets/global.json"),

          -- Load snippets based on current language by reading files from
          -- "snippets/" subdirectories from 'runtimepath' directories.
          snippets.gen_loader.from_lang(), -- this is the default in the extra...
        }
      end,
    },
  }
--]]
end

```

It's possible to use the code from this PR directly in your own
configuration:

1. Copy the code to lua/extras/coding/mini_snippets.lua in your config
folder
2. Restart nvim and enable the "user" extra for `mini.snippets`
3. Restart nvim
 
## Checklist

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

---------

Co-authored-by: abeldekat <abel@nomail.com>
2025-01-23 12:03:36 +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
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
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
ef9102677f
feat(keymaps): unlink luasnip on esc 2024-12-15 11:46: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
a9a273d041
fix: fqn for nvim-cmp 2024-12-12 14:45:47 +01:00
Folke Lemaitre
88e77b0e24 fix(nvim-cmp): specs 2024-12-12 13:47:29 +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
Folke Lemaitre
2cbfb9b6b7 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
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
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
7bb954fd1d
fix(blink): fixed luasnip completions for blink 2024-11-28 07:39:30 +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