nvim/lua/plugins/lsp.lua

29 lines
921 B
Lua
Raw Normal View History

2023-06-08 16:38:02 -04:00
return {
{
"neovim/nvim-lspconfig",
init = function()
local format = function()
require("lazyvim.plugins.lsp.format").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" }
2023-06-12 09:07:22 -04:00
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" })
2023-06-08 16:38:02 -04:00
end,
opts = {
autoformat = false,
servers = {
yamlls = {
settings = {
yaml = {
keyOrdering = false,
},
},
},
},
2023-06-08 16:38:02 -04:00
},
},
}