nvim-config/lua/plugins/lsp.lua
2024-04-30 11:24:23 +01:00

42 lines
1.1 KiB
Lua

return {
{"williamboman/mason.nvim",
config=function()
require("mason").setup()
end
},
{
"williamboman/mason-lspconfig.nvim",
config=function()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"ruff_lsp",
"pyright",
}
})
end
},
{
"neovim/nvim-lspconfig",
config=function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({
capabilities=capabilities
})
lspconfig.pyright.setup({
capabilities=capabilities
})
lspconfig.ruff_lsp.setup({
capabilities=capabilities
})
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
vim.keymap.set({"n", "v"}, "<leader>ca", vim.lsp.buf.code_action, {})
end
}
}