nvim/lua/plugins/completion.lua
devaine bd2f808931
feat(keybinds, lua func, cmp): QOL changes basically
- removed hindering material like nvim adding more comments upon
  pressing `Enter`
- removed snippets, not needed + disrupted commenting
- added more keybinds (telescope.nvim, wrap around pairs, venv
  selection)
- added QOL changes like venv-selector + ecolog.nvim w/
- added blink.cmp provders (ecolog + convential commits)
2026-08-16 20:36:12 -05:00

75 lines
1.6 KiB
Lua
Executable file

return {
{
"saghen/blink.cmp",
dependencies = {
{ "disrupted/blink-cmp-conventional-commits" }
},
version = "1.*",
opts = {
keymap = {
preset = "none",
["<Tab>"] = {
function(cmp)
local cursor_pos = vim.api.nvim_win_get_cursor(0)
local col = cursor_pos[2]
local current_line = vim.api.nvim_get_current_line()
if cmp.is_menu_visible() then
cmp.select_next()
return
end
if current_line:sub(col, col) == "." then
if not cmp.is_menu_visible() then
cmp.show()
return
end
end
return "\t"
end,
},
["<S-Tab>"] = { "select_prev", "fallback" },
["<CR>"] = { "select_and_accept", "fallback" },
["<C-e>"] = { "show", "hide", "fallback" },
},
completion = {
trigger = {
show_on_x_blocked_trigger_characters = { ".", "[", "]", "(", ")", "/", '"' },
},
documentation = {
auto_show = true,
treesitter_highlighting = true,
},
menu = { auto_show = true },
ghost_text = { enabled = true },
},
sources = {
default = { "lsp", "path", "ecolog", "conventional_commits" },
min_keyword_length = 0,
providers = {
ecolog = {
name = "ecolog",
module = "ecolog.integrations.cmp.blink_cmp"
},
conventional_commits = {
name = 'Conventional Commits',
module = 'blink-cmp-conventional-commits',
enabled = function()
return vim.bo.filetype == 'gitcommit'
end,
opts = {
},
}
}
},
signature = { enabled = true },
fuzzy = { implementation = "prefer_rust_with_warning" },
},
},
}