nvim/lua/plugins/lsp.lua
2024-07-16 11:59:51 -04:00

55 lines
1.3 KiB
Lua

return {
{
"neovim/nvim-lspconfig",
init = function()
local format = function()
require("lazyvim.util").format({ force = true })
end
local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Document", has = "documentFormatting" }
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }
keys[#keys + 1] = { "K", false } -- su puta madre!
vim.diagnostic.config({
float = { border = "rounded" },
})
end,
opts = {
diagnostics = {
update_in_insert = true,
},
setup = {
rust_analyzer = function()
return true
end,
},
servers = {
yamlls = {
settings = {
yaml = {
keyOrdering = false,
},
},
},
lua_ls = {
root_dir = function()
return vim.loop.cwd()
end,
-- ---@type LazyKeys[]
-- keys = {},
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
},
},
},
},
},
},
}