2022-04-26 06:42:45 +00:00
|
|
|
local lsp_status = require("lsp-status")
|
|
|
|
lsp_status.config({
|
|
|
|
current_function = false,
|
|
|
|
show_filename = false,
|
|
|
|
diagnostics = true,
|
|
|
|
})
|
|
|
|
lsp_status.register_progress()
|
|
|
|
|
|
|
|
local utils = require("nvim-lsp-setup.utils")
|
|
|
|
|
2022-04-25 18:18:25 +00:00
|
|
|
require("nvim-lsp-setup").setup({
|
|
|
|
default_mappings = false,
|
|
|
|
mappings = {
|
|
|
|
gD = "lua vim.lsp.buf.declaration()",
|
|
|
|
gd = "Telescope lsp_definitions",
|
|
|
|
gt = "Telescope lsp_type_definitions",
|
|
|
|
gi = "Telescope lsp_implementations",
|
|
|
|
gr = "Telescope lsp_references",
|
|
|
|
K = "lua vim.lsp.buf.hover()",
|
|
|
|
["<C-k>"] = "lua vim.lsp.buf.signature_help()",
|
|
|
|
["<leader>rn"] = "lua vim.lsp.buf.rename()",
|
|
|
|
["<leader>ca"] = "Telescope lsp_code_actions theme=cursor",
|
|
|
|
["<leader>f"] = "lua vim.lsp.buf.formatting()",
|
|
|
|
["<leader>e"] = "lua vim.lsp.diagnostic.show_line_diagnostics()",
|
|
|
|
["<leader>d"] = "Telescope diagnostics",
|
|
|
|
["<C-p>"] = "lua vim.diagnostic.goto_prev()",
|
|
|
|
["<C-n>"] = "lua vim.diagnostic.goto_next()",
|
|
|
|
},
|
|
|
|
on_attach = function(client)
|
2022-04-26 06:42:45 +00:00
|
|
|
utils.format_on_save(client)
|
2022-04-25 18:18:25 +00:00
|
|
|
require("illuminate").on_attach(client)
|
2022-04-26 06:42:45 +00:00
|
|
|
lsp_status.on_attach(client)
|
2022-04-25 18:18:25 +00:00
|
|
|
end,
|
2022-04-26 06:42:45 +00:00
|
|
|
capabilities = vim.tbl_extend("keep", vim.lsp.protocol.make_client_capabilities(), lsp_status.capabilities),
|
2022-04-25 18:18:25 +00:00
|
|
|
servers = {
|
|
|
|
ansiblels = {},
|
|
|
|
bashls = {},
|
|
|
|
dockerls = {},
|
|
|
|
eslint = {},
|
|
|
|
jsonls = {},
|
|
|
|
pylsp = {},
|
|
|
|
rust_analyzer = require("nvim-lsp-setup.rust-tools").setup({
|
|
|
|
server = {
|
|
|
|
settings = {
|
|
|
|
["rust-analyzer"] = {
|
|
|
|
cargo = {
|
|
|
|
loadOutDirsFromCheck = true,
|
|
|
|
},
|
|
|
|
checkOnSave = { command = "clippy" },
|
|
|
|
procMacro = {
|
|
|
|
enable = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
2022-04-25 18:50:42 +00:00
|
|
|
sumneko_lua = require('lua-dev').setup({}),
|
2022-04-25 18:18:25 +00:00
|
|
|
terraformls = {},
|
|
|
|
volar = {},
|
|
|
|
},
|
|
|
|
})
|