chore(honme-manager): rework neovim cmp plugin configuration

This commit is contained in:
Yorick Barbanneau 2025-04-25 16:54:33 +02:00
parent f2569180aa
commit ca3b35afc0
No known key found for this signature in database
GPG key ID: 4447A19BBEDB8DBA
3 changed files with 44 additions and 23 deletions

View file

@ -177,20 +177,6 @@ in
config = ( builtins.readFile ./files/plugins/treesitter_context.lua); config = ( builtins.readFile ./files/plugins/treesitter_context.lua);
} }
{
plugin = lspsaga-nvim;
type = "lua";
config = ''
require('lspsaga').setup {
ui = {
code_action = ''
},
lightbulb = {
virtual_text = false
}
}
'';
}
{ {
plugin = which-key-nvim; plugin = which-key-nvim;
type = "lua"; type = "lua";

View file

@ -66,16 +66,16 @@ vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
vim.cmd('au BufWinLeave *.* mkview') vim.cmd('au BufWinLeave *.* mkview')
vim.cmd('au BufWinEnter *.* silent! loadview') vim.cmd('au BufWinEnter *.* silent! loadview')
local signs = { Error = "", Warn = "", Hint = "󰌶", Info = "" } -- local signs = { Error = "", Warn = "", Hint = "󰌶", Info = "" }
for type, icon in pairs(signs) do -- for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type -- local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end -- end
-- You will likely want to reduce updatetime which affects CursorHold -- You will likely want to reduce updatetime which affects CursorHold
-- note: this setting is global and should be set only once -- note: this setting is global and should be set only once
vim.o.updatetime = 250 vim.o.updatetime = 250
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]] -- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]]
-- Autotype -- Autotype
vim.cmd('au BufRead,BufNewFile *.nix setlocal tabstop=2 shiftwidth=2 ') vim.cmd('au BufRead,BufNewFile *.nix setlocal tabstop=2 shiftwidth=2 ')
@ -124,12 +124,13 @@ vim.g.matchparen_insert_timeout = 2
-- activate virtual lines for diagnistics -- activate virtual lines for diagnistics
-- no more plugins needed -- no more plugins needed
local x = vim.diagnostic.severity
vim.diagnostic.config({ vim.diagnostic.config({
virtual_lines = true virtual_lines = true,
-- Alternatively, customize specific options -- Alternatively, customize specific options
-- virtual_lines = { -- virtual_lines = {
-- -- Only show virtual line diagnostics for the current cursor line -- -- Only show virtual line diagnostics for the current cursor line
-- current_line = true, -- current_line = true,
-- }, -- },
signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } },
}) })

View file

@ -1,8 +1,14 @@
require("blink.cmp").setup({ require("blink.cmp").setup({
keymap = { keymap = {
preset = "cmdline", preset = "none",
['<C-b>'] = { 'scroll_documentation_up', 'fallback' }, ['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' }, ['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' },
['<C-space>'] = { 'show', 'fallback' },
['<C-y>'] = { 'select_and_accept' },
['<C-e>'] = { 'cancel' },
}, },
completion = { completion = {
menu = { menu = {
@ -38,6 +44,16 @@ require("blink.cmp").setup({
"dictionary", "dictionary",
}, },
providers = { providers = {
path = {
module = 'blink.cmp.sources.path',
score_offset = 3,
opts = {
trailing_slash = false,
label_trailing_slash = false,
get_cwd = function(context) return vim.fn.expand(('#%d:p:h'):format(context.bufnr)) end,
show_hidden_files_by_default = true,
}
},
emoji = { emoji = {
module = "blink-emoji", module = "blink-emoji",
name = "Emoji", name = "Emoji",
@ -61,8 +77,26 @@ require("blink.cmp").setup({
end, end,
}, },
}, },
buffer = {
module = 'blink.cmp.sources.buffer',
score_offset = -3,
min_keyword_length = 4,
opts = {
-- default to all visible buffers
get_bufnrs = function()
return vim
.iter(vim.api.nvim_list_wins())
:map(function(win) return vim.api.nvim_win_get_buf(win) end)
:filter(function(buf) return vim.bo[buf].buftype ~= 'nofile' end)
:totable()
end,
}
},
}, },
}, },
fuzzy = {
max_typos = function() return 0 end,
},
cmdline = { cmdline = {
enabled = false, enabled = false,
}, },