diff options
author | 2025-07-20 17:15:54 -0400 | |
---|---|---|
committer | 2025-07-20 17:15:54 -0400 | |
commit | 8148b432d1ff51b094b8c6e109f791400ba54e5b (patch) | |
tree | dcc821d9a5b439e8da926c027ddbd501b45cfb3f /after/plugin/lsp.lua | |
parent | 9bf89c0eba6f5c7ba64aceb6430e2a90da4b325c (diff) | |
download | nvim-8148b432d1ff51b094b8c6e109f791400ba54e5b.tar.gz nvim-8148b432d1ff51b094b8c6e109f791400ba54e5b.zip |
Diffstat (limited to 'after/plugin/lsp.lua')
-rw-r--r-- | after/plugin/lsp.lua | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 3f790d7..64cae8f 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -53,27 +53,32 @@ cmp.setup.cmdline(':', { matching = { disallow_symbol_nonprefix_matching = false } }) -local function onattach(client, buf) - nn("gD", vim.lsp.buf.declaration) - nn("gd", vim.lsp.buf.definition) - nn("<Leader>K", vim.lsp.buf.hover) - nn("gi", vim.lsp.buf.implementation) - nn("<C-k>", vim.lsp.buf.signature_help) - nn("<Leader>D", vim.lsp.buf.type_definition) - nn("<Leader>r", vim.lsp.buf.rename) - nn("<Leader>A", vim.lsp.buf.code_action) - nn("<Leader>R", vim.lsp.buf.references) - nn("<Leader>f", vim.lsp.buf.format) -end - -local caps = vim.lsp.protocol.make_client_capabilities() -caps = cmp_lsp.default_capabilities(caps) +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + nn("gD", vim.lsp.buf.declaration) + nn("gd", vim.lsp.buf.definition) + nn("<Leader>K", vim.lsp.buf.hover) + nn("gi", vim.lsp.buf.implementation) + nn("<C-k>", vim.lsp.buf.signature_help) + nn("<Leader>D", vim.lsp.buf.type_definition) + nn("<Leader>r", vim.lsp.buf.rename) + nn("<Leader>A", vim.lsp.buf.code_action) + nn("<Leader>R", vim.lsp.buf.references) + nn("<Leader>f", vim.lsp.buf.format) + end, +}) -local servers = {'clangd', 'rust_analyzer', 'zls', 'texlab', 'biome'} +local servers = {'clangd', 'rust_analyzer', 'zls', 'texlab', 'biome', 'tinymist'} for _, lsp in pairs(servers) do - lspconfig[lsp].setup { - capabilities = caps, - on_attach = onattach, - flags = { debounce_text_changes = 500 } - } + vim.lsp.enable(lsp) end + +vim.diagnostic.config({ + virtual_text = false, + virtual_lines = true, + signs = true, + update_in_insert = false, + underline = true, + severity_sort = false, + float = true, +}) |