summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins/lsp.lua')
-rw-r--r--.config/nvim/lua/plugins/lsp.lua32
1 files changed, 15 insertions, 17 deletions
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
index 4bb7659..7a67265 100644
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -16,6 +16,9 @@ return {
"gopls",
"lua_ls",
"pylsp",
+ "ts_ls",
+ "cssls",
+ "html",
}
for _, lsp in ipairs(lsps) do
@@ -24,29 +27,24 @@ return {
local wk = require("which-key")
wk.register({
- ["[d"] = { vim.diagnostic.goto_prev, "Previous diagnostic" },
- ["]d"] = { vim.diagnostic.goto_next, "Next diagnostic" },
+ { "[d", vim.diagnostic.goto_prev, desc = "Previous diagnostic" },
+ { "]d", vim.diagnostic.goto_next, desc = "Next diagnostic" },
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
wk.register({
- gD = { vim.lsp.buf.declaration, "Go to declaration" },
- gd = { vim.lsp.buf.definition, "Go to definition" },
- gr = { vim.lsp.buf.references, "Go to references" },
- gi = { vim.lsp.buf.implementation, "Go to implementation" },
- K = { vim.lsp.buf.hover, "Show LSP hover info" },
- ["<C-k>"] = { vim.lsp.buf.signature_help, "Show signature help" },
- ["<leader>D"] = { vim.lsp.buf.type_definition, "Type definition" },
- ["<leader>rn"] = { vim.lsp.buf.rename, "Rename" },
- ["<leader>ca"] = { vim.lsp.buf.code_action, "Code action" },
- ["<leader>F"] = {
- function()
- vim.lsp.buf.format({ async = true })
- end,
- "Format buffer",
- },
+ { "gD", vim.lsp.buf.declaration, desc = "Go to declaration" },
+ { "gd", vim.lsp.buf.definition, desc = "Go to definition" },
+ { "gr", vim.lsp.buf.references, desc = "Go to references" },
+ { "gi", vim.lsp.buf.implementation, desc = "Go to implementation" },
+ { "K", vim.lsp.buf.hover, desc = "Show LSP hover info" },
+ { "<C-k>", vim.lsp.buf.signature_help, desc = "Show signature help" },
+ { "<leader>D", vim.lsp.buf.type_definition, desc = "Type definition" },
+ { "<leader>rn", vim.lsp.buf.rename, desc = "Rename" },
+ { "<leader>ca", vim.lsp.buf.code_action, desc = "Code action" },
+ { "<leader>F", function() vim.lsp.buf.format({ async = true }) end, desc = "Format buffer" },
["<leader>w"] = {
name = "+LSP workspace",
a = { vim.lsp.buf.add_workspace_folder, "Add workspace folder" },