]> src.twobees.de Git - dotfiles.git/blob - stow/nvim/.config/nvim/lua/lspsetup.lua
link legacy vim dir on windows
[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 require'lspconfig'.bashls.setup({})
17
18 require'lspconfig'.perlls.setup{
19     settings = {
20         perl = {
21             fileFilter = { ".pm", ".pl" },
22             ignoreDirs = ".git",
23             perlCmd = "perl",
24             perlInc = " "
25         }
26     },
27     single_file_support = true
28 }
29
30
31 require'lspconfig'.sumneko_lua.setup {
32     filetypes = { "lua"},
33     settings = {
34         Lua = {
35             runtime = {
36                 -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
37                 version = 'LuaJIT',
38             },
39             diagnostics = {
40                 -- Get the language server to recognize the `vim` global
41                 globals = {'vim'},
42             },
43             workspace = {
44                 -- Make the server aware of Neovim runtime files
45                 library = vim.api.nvim_get_runtime_file("", true),
46             },
47             -- Do not send telemetry data containing a randomized but unique identifier
48             telemetry = {
49                 enable = false,
50             },
51         },
52     },
53 }