feat: add blink.cmp and disable custom completion pipeline

This commit is contained in:
2026-04-17 02:37:17 +02:00
parent f4d3a35171
commit ad45c6fdf6
6 changed files with 160 additions and 17 deletions
+37 -3
View File
@@ -99,9 +99,7 @@ vim.keymap.set("n", "gr", "<Nop>")
vim.cmd.aunmenu({ "PopUp.-1-" })
vim.cmd.aunmenu({ "PopUp.How-to\\ disable\\ mouse" })
-- Insert-mode Emacs bindings
vim.keymap.set("i", "<C-f>", "<Right>")
vim.keymap.set("i", "<C-b>", "<Left>")
-- Insert-mode Emacs bindings (C-f/C-b live further down inside hover_scroll_map)
vim.keymap.set("i", "<C-a>", "<C-o>^")
vim.keymap.set("i", "<C-e>", function()
-- Fall through to Vim's default (close popup + revert) during completion.
@@ -160,8 +158,43 @@ vim.keymap.set("n", "K", function()
vim.lsp.buf.hover({ max_width = 80 })
end)
vim.keymap.set({ "i", "s" }, "<C-s>", function()
local winid = vim.b.lsp_floating_preview
if winid and vim.api.nvim_win_is_valid(winid) then
vim.api.nvim_win_close(winid, false)
return
end
vim.lsp.buf.signature_help({ max_width = 80 })
end)
---@param mode string | string[]
---@param key string
---@param direction "up" | "down"
---@param count integer
---@param fallback? string
local function hover_scroll_map(mode, key, direction, count, fallback)
vim.keymap.set(mode, key, function()
local winid = vim.b.lsp_floating_preview
if not winid or not vim.api.nvim_win_is_valid(winid) then
return fallback or key
end
vim.schedule(function()
local scroll_key = direction == "down" and vim.keycode("<C-e>")
or vim.keycode("<C-y>")
vim.api.nvim_win_call(winid, function()
vim.cmd.normal({
args = { count .. scroll_key },
bang = true,
})
end)
end)
return ""
end, { expr = true, replace_keycodes = true })
end
hover_scroll_map({ "n", "s" }, "<C-f>", "down", 5)
hover_scroll_map({ "n", "s" }, "<C-b>", "up", 5)
hover_scroll_map("i", "<C-f>", "down", 5, "<Right>")
hover_scroll_map("i", "<C-b>", "up", 5, "<Left>")
---@param key string
---@param dir 1 | -1
local function snippet_jump_map(key, dir)
@@ -174,6 +207,7 @@ local function snippet_jump_map(key, dir)
end
snippet_jump_map("<Tab>", 1)
snippet_jump_map("<S-Tab>", -1)
vim.keymap.set({ "n", "i" }, "<C-h>", vim.lsp.buf.document_highlight)
vim.keymap.set({ "n", "x" }, "<leader>lf", vim.lsp.buf.format)
vim.keymap.set("n", "grl", function()