From 8148b432d1ff51b094b8c6e109f791400ba54e5b Mon Sep 17 00:00:00 2001 From: Matthew Wozniak Date: Sun, 20 Jul 2025 17:15:54 -0400 Subject: new binds, monochrome --- after/plugin/lsp.lua | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'after/plugin/lsp.lua') 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("K", vim.lsp.buf.hover) - nn("gi", vim.lsp.buf.implementation) - nn("", vim.lsp.buf.signature_help) - nn("D", vim.lsp.buf.type_definition) - nn("r", vim.lsp.buf.rename) - nn("A", vim.lsp.buf.code_action) - nn("R", vim.lsp.buf.references) - nn("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("K", vim.lsp.buf.hover) + nn("gi", vim.lsp.buf.implementation) + nn("", vim.lsp.buf.signature_help) + nn("D", vim.lsp.buf.type_definition) + nn("r", vim.lsp.buf.rename) + nn("A", vim.lsp.buf.code_action) + nn("R", vim.lsp.buf.references) + nn("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, +}) -- cgit v1.2.3-54-g00ecf