Compare commits

..

2 Commits

Author SHA1 Message Date
c02781e3bf fix(blink.cmp): suggestions priority
- Put the snippets first
- https://github.com/Saghen/blink.cmp/issues/1098#issuecomment-2679295335
2025-07-17 13:39:08 +02:00
aca3a6f5b6 feat!(blink): Default bindings
BREAKING CHANGE: use ^y instead of <Tab> to complete
2025-07-17 09:26:52 +02:00

View File

@@ -1,3 +1,10 @@
local source_priority = {
snippets = 4,
lsp = 3,
path = 2,
buffer = 1
}
require('lazy').setup({ require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration -- NOTE: First, some plugins that don't require any configuration
@@ -37,6 +44,7 @@ require('lazy').setup({
-- DAP: Debug Adapter Protocol -- DAP: Debug Adapter Protocol
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
{ {
-- [[ Autocompletion ]] -- [[ Autocompletion ]]
'saghen/blink.cmp', 'saghen/blink.cmp',
@@ -68,7 +76,7 @@ require('lazy').setup({
-- C-k: Toggle signature help (if signature.enabled = true) -- C-k: Toggle signature help (if signature.enabled = true)
-- --
-- See :h blink-cmp-config-keymap for defining your own keymap -- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = 'super-tab' }, keymap = { preset = 'default' },
appearance = { appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
@@ -103,7 +111,21 @@ require('lazy').setup({
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
-- --
-- See the fuzzy documentation for more information -- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" } fuzzy = {
implementation = "prefer_rust_with_warning",
sorts = {
function(a, b)
local a_priority = source_priority[a.source_id];
local b_priority = source_priority[b.source_id];
if a_priority ~= b_priority then
return a_priority > b_priority
end
end,
-- default
'score',
'sort_text'
}
}
}, },
opts_extend = { "sources.default" } opts_extend = { "sources.default" }
}, },