summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/setup/lspconfig.lua
blob: d22450e62a712a76f4e60935e178bbf9a47ebcf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local lspconfig = require("lspconfig")

local function on_attach()
    vim.cmd("doautocmd User lspAttached")
end

lspconfig.lua_ls.setup {
    on_attach = on_attach,
    settings = {
        Lua = {
            diagnostics = {
                globals = { 'vim' }
            }
        }
    }
}
lspconfig.bashls.setup {
    on_attach = on_attach,
}
lspconfig.pyright.setup{
    on_attach = on_attach,
}

local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
    local hl = "DiagnosticSign" .. type
    vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end