]> src.twobees.de Git - dotfiles.git/blob - stow/nvim/.config/nvim/lua/lspsetup.lua
initial
[dotfiles.git] / stow / nvim / .config / nvim / lua / lspsetup.lua
1 vim.api.nvim_create_autocmd('LspAttach', {
2     callback = function()
3         vim.keymap.set ("n", "K", vim.lsp.buf.hover, { buffer=0}) -- buffer=0 -> only in current buffer
4         vim.keymap.set ("n", "gd", vim.lsp.buf.definition, { buffer=0}) -- goto definition
5         vim.keymap.set ("n", "gT", vim.lsp.buf.type_definition, { buffer=0}) -- goto typedefinition
6         vim.keymap.set ("n", "gi", vim.lsp.buf.implementation, { buffer=0}) -- goto implementation
7         vim.keymap.set ("n", "dj", vim.diagnostic.goto_next, { buffer=0}) -- goto dignostic next
8         vim.keymap.set ("n", "dk", vim.diagnostic.goto_prev, { buffer=0}) -- goto diognostic prev
9         vim.keymap.set ("n", "dl", "<cmd>Telescope diagnostic", { buffer=0}) -- goto list failure
10         vim.keymap.set ("n", "<leader>r", vim.lsp.buf.rename, { buffer=0})
11     end,
12 })
13 require("mason").setup()
14
15 require'lspconfig'.csharp_ls.setup({})
16
17 require'lspconfig'.perlls.setup{
18     settings = {
19         perl = {
20             fileFilter = { ".pm", ".pl" },
21             ignoreDirs = ".git",
22             perlCmd = "perl",
23             perlInc = " "
24         }
25     },
26     single_file_support = true
27 }
28
29
30 require'lspconfig'.sumneko_lua.setup {
31     filetypes = { "lua"},
32     settings = {
33         Lua = {
34             runtime = {
35                 -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
36                 version = 'LuaJIT',
37             },
38             diagnostics = {
39                 -- Get the language server to recognize the `vim` global
40                 globals = {'vim'},
41             },
42             workspace = {
43                 -- Make the server aware of Neovim runtime files
44                 library = vim.api.nvim_get_runtime_file("", true),
45             },
46             -- Do not send telemetry data containing a randomized but unique identifier
47             telemetry = {
48                 enable = false,
49             },
50         },
51     },
52 }