feat: lsp
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user