feat: switch to blink.cmp for completion

This commit is contained in:
Devin Haska 2025-06-10 22:10:49 -07:00
parent b2e8d512ab
commit e4c4ec589a
Signed by: wonderfulfrog
SSH key fingerprint: SHA256:ejOGyH9064rJiikox4ykOHLeuUg1f9l8wmJxs+MzNw0
2 changed files with 87 additions and 76 deletions

View file

@ -1,7 +1,5 @@
{
"LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
"conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" },
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
@ -17,7 +15,6 @@
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
"neo-tree.nvim": { "branch": "main", "commit": "e01ca7de8e6dbc6118bcb12c4cbe1f88162a337f" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "77d3fdfb3554632c7a3b101ded643d422de7626f" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },

View file

@ -1,78 +1,92 @@
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
},
config = function()
local cmp = require("cmp")
cmp.setup({
-- Highlights the first result always
completion = {
completeopt = "menu,menuone,noinsert",
},
window = {
completion = cmp.config.window.bordered({
side_padding = 1,
scrollbar = false,
}),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-o>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i" }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
})
end,
},
{
"L3MON4D3/LuaSnip",
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load({
exclude = { "html" },
})
end,
},
},
build = "make install_jsregexp",
"saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets" },
version = "1.*",
opts = {
history = true,
delete_check_events = "TextChanged",
keymap = {
preset = "enter",
["<S-Tab>"] = { "select_prev", "fallback" },
["<Tab>"] = { "select_next", "fallback" },
["<Enter>"] = { "select_and_accept", "fallback" },
},
completion = { documentation = { auto_show = true } },
},
},
-- {
-- "hrsh7th/nvim-cmp",
-- dependencies = {
-- "hrsh7th/cmp-nvim-lsp",
-- "hrsh7th/cmp-buffer",
-- },
-- config = function()
-- local cmp = require("cmp")
--
-- cmp.setup({
-- -- Highlights the first result always
-- completion = {
-- completeopt = "menu,menuone,noinsert",
-- },
-- window = {
-- completion = cmp.config.window.bordered({
-- side_padding = 1,
-- scrollbar = false,
-- }),
-- },
-- mapping = cmp.mapping.preset.insert({
-- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
-- ["<C-o>"] = cmp.mapping.complete(),
-- ["<C-e>"] = cmp.mapping.abort(),
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- else
-- fallback()
-- end
-- end, { "i" }),
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- else
-- fallback()
-- end
-- end, { "i" }),
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
-- }),
--
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
--
-- sources = cmp.config.sources({
-- { name = "nvim_lsp" },
-- { name = "nvim_lsp_signature_help" },
-- { name = "luasnip" },
-- }, {
-- { name = "buffer" },
-- }),
-- })
-- end,
-- },
-- {
-- "L3MON4D3/LuaSnip",
-- dependencies = {
-- {
-- "rafamadriz/friendly-snippets",
-- config = function()
-- require("luasnip.loaders.from_vscode").lazy_load({
-- exclude = { "html" },
-- })
-- end,
-- },
-- },
-- build = "make install_jsregexp",
-- opts = {
-- history = true,
-- delete_check_events = "TextChanged",
-- },
-- },
}