diff options
Diffstat (limited to 'config/nvim/lua/plugins/blink.lua')
| -rw-r--r-- | config/nvim/lua/plugins/blink.lua | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/config/nvim/lua/plugins/blink.lua b/config/nvim/lua/plugins/blink.lua index 4603999..6e2ac83 100644 --- a/config/nvim/lua/plugins/blink.lua +++ b/config/nvim/lua/plugins/blink.lua @@ -6,12 +6,11 @@ return { version = "*", opts = { - keymap = { preset = "enter", -- Select completions - ["<Up>"] = { "select_prev", "fallback" }, - ["<Down>"] = { "select_next", "fallback" }, + ["<Up>"] = { "fallback" }, + ["<Down>"] = { "fallback" }, ["<Tab>"] = { "select_next", "fallback" }, ["<S-Tab>"] = { "select_prev", "fallback" }, ["<CR-space>"] = { "show", "hide", "fallback" }, @@ -30,7 +29,22 @@ return { default = { "lsp", "path", "snippets", "buffer" }, }, - fuzzy = { implementation = "prefer_rust_with_warning" }, + fuzzy = { + implementation = "prefer_rust_with_warning", + max_typos = function(keyword) return math.floor(#keyword / 8) end, + sorts = { + function(a, b) + local kind = require('blink.cmp.types').CompletionItemKind.Keyword + if a.kind == kind and b.kind ~= kind then + return true + elseif a.kind ~= kind and b.kind == kind then + return false + end + end, + 'score', + 'sort_text' + } + }, completion = { -- The keyword should only match against the text before keyword = { range = "prefix" }, |
