X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Fnvim%2F.config%2Fnvim%2Flua%2Flspsetup.lua;h=2c73f65325a433ce42467b90564113d5e91c4c0a;hb=2c93f0b568b97cb47b203607f501f234f12a5c4d;hp=2701515ec7719b3b8cc6b442fffdca127a4688bb;hpb=bf1e668ae26a54b3294ca4c99e42ec0c7166600a;p=dotfiles.git diff --git a/stow/nvim/.config/nvim/lua/lspsetup.lua b/stow/nvim/.config/nvim/lua/lspsetup.lua index 2701515..2c73f65 100644 --- a/stow/nvim/.config/nvim/lua/lspsetup.lua +++ b/stow/nvim/.config/nvim/lua/lspsetup.lua @@ -1,52 +1,12 @@ -vim.api.nvim_create_autocmd('LspAttach', { - callback = function() - vim.keymap.set ("n", "K", vim.lsp.buf.hover, { buffer=0}) -- buffer=0 -> only in current buffer - vim.keymap.set ("n", "gd", vim.lsp.buf.definition, { buffer=0}) -- goto definition - vim.keymap.set ("n", "gT", vim.lsp.buf.type_definition, { buffer=0}) -- goto typedefinition - vim.keymap.set ("n", "gi", vim.lsp.buf.implementation, { buffer=0}) -- goto implementation - vim.keymap.set ("n", "dj", vim.diagnostic.goto_next, { buffer=0}) -- goto dignostic next - vim.keymap.set ("n", "dk", vim.diagnostic.goto_prev, { buffer=0}) -- goto diognostic prev - vim.keymap.set ("n", "dl", "Telescope diagnostic", { buffer=0}) -- goto list failure - vim.keymap.set ("n", "r", vim.lsp.buf.rename, { buffer=0}) - end, -}) -require("mason").setup() - -require'lspconfig'.csharp_ls.setup({}) - -require'lspconfig'.perlls.setup{ - settings = { - perl = { - fileFilter = { ".pm", ".pl" }, - ignoreDirs = ".git", - perlCmd = "perl", - perlInc = " " - } - }, - single_file_support = true -} - - -require'lspconfig'.sumneko_lua.setup { - filetypes = { "lua"}, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} +local lsp = require('lsp-zero') + +lsp.preset('recommended') +lsp.setup() + +vim.lsp.handlers["textDocument/publishDiagnostics"] = + vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, + { + virtual_text = true, -- inline diagnostic on line end + } +)