1
0

feat(nvim): Use vanila neovim lsp client

This commit is contained in:
2025-07-04 21:57:53 +02:00
parent a6f1537b1d
commit b3a59604a3
6 changed files with 113 additions and 229 deletions

View File

@@ -1,36 +1,97 @@
local blink_methods = {
icon = function(ctx)
local icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
return icon
end,
highlight = function(ctx)
local _, hi, _ = require('mini.icons').get('lsp', ctx.kind)
vim.print(hi)
return hi
end,
}
return {
-- Mason
{ 'williamboman/mason.nvim', opts = {}, cmd = 'Mason', event = 'VeryLazy' },
{ 'williamboman/mason-lspconfig.nvim', opts = {}, event = 'VeryLazy' },
-- Lsp configuration
{ 'VonHeikemen/lsp-zero.nvim' },
{ 'neovim/nvim-lspconfig' },
-- Completion
{ 'mason-org/mason.nvim', opts = {} },
{
'hrsh7th/nvim-cmp',
event = 'VeryLazy',
dependencies = {
'hrsh7th/cmp-calc',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-nvim-lsp',
'onsails/lspkind.nvim',
},
},
-- Additions
{
'ray-x/lsp_signature.nvim',
event = 'VeryLazy',
'mason-org/mason-lspconfig.nvim',
version = '1.*',
opts = {
hint_prefix = '',
ensure_installed = { 'lua_ls', 'rust_analyzer' },
},
config = function(lazy)
local mlspconfig = require('mason-lspconfig')
mlspconfig.setup(lazy.opts)
mlspconfig.setup_handlers({
vim.lsp.enable,
})
end,
dependencies = {
'mason-org/mason.nvim',
},
},
-- Rust
-- { 'mrcjkb/rustaceanvim' },
{
'Saghen/blink.cmp',
dependencies = {
'echasnovski/mini.icons',
},
version = '1.*',
build = 'cargo build --release',
opts = {
keymap = {
preset = 'default',
['<Up>'] = { 'select_prev', 'fallback' },
['<Down>'] = { 'select_next', 'fallback' },
['<Tab>'] = { 'accept', 'fallback' },
},
appearance = {
nerd_font_variant = 'normal',
},
sources = {
default = { 'lsp', 'buffer', 'path', 'omni' },
},
completion = {
list = { selection = { auto_insert = false } },
documentation = {
auto_show = true,
auto_show_delay_ms = 700,
},
ghost_text = { enabled = true },
menu = {
auto_show = true,
draw = {
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
components = {
kind_icon = {
text = blink_methods.icon,
},
kind = {
text = function(ctx)
return '(' .. ctx.kind .. ')'
end,
highlight = 'SpecialKey',
},
},
},
},
},
cmdline = {
enabled = true,
keymap = { preset = 'inherit' },
sources = { 'buffer', 'cmdline' },
completion = {
list = { selection = { preselect = true, auto_insert = false } },
ghost_text = { enabled = true },
menu = {
auto_show = true,
},
},
},
signature = { enabled = true, window = { show_documentation = true } },
},
},
}