feat: lsp

This commit is contained in:
2025-10-23 20:16:45 +03:00
parent bb12a11cc0
commit 173ff5e47a
8 changed files with 471 additions and 30 deletions

View File

@@ -75,3 +75,5 @@ map('n', '[d', function()
vim.diagnostic.jump({ count = -1, float = true })
end)
map('n', '<leader>q', vim.diagnostic.setloclist)
map('n', '<leader>d', vim.diagnostic.open_float)
map('n', '<leader>s', vim.lsp.buf.signature_help)

View File

@@ -71,7 +71,7 @@ vim.opt.mouse = 'a' -- Enable mouse support
vim.opt.ignorecase = true
vim.opt.smartcase = true -- Override ignorecase if search contains upper case chars
vim.opt.inccommand = 'split' -- Live substitution preview
vim.opt.completeopt = { 'menu,menuone,noselect' }
vim.opt.completeopt = { 'fuzzy,menuone,popup,preview,noselect' }
-- Splits
vim.opt.splitright = true
@@ -87,22 +87,3 @@ vim.opt.timeout = true
vim.opt.ttimeout = true
vim.opt.timeoutlen = 500
vim.opt.ttimeoutlen = 10
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { noremap = true, silent = true })
vim.diagnostic.config({
update_in_insert = false,
virtual_text = {
prefix = '', -- remove annoying ▎ etc
format = function(diagnostic)
if diagnostic.source then
return string.format('[%s] %s', diagnostic.source, diagnostic.message)
end
return diagnostic.message
end,
},
float = {
border = 'rounded',
source = true, -- show source in floating window too
},
severity_sort = true,
})