57 lines
1.4 KiB
Lua
57 lines
1.4 KiB
Lua
---@module "utils.plugins"
|
|
---@type Plugin
|
|
return {
|
|
after = { "mason", "blink.cmp" },
|
|
configure = function(load)
|
|
load("neovim/nvim-lspconfig")
|
|
|
|
-- Reserve a space in the gutter
|
|
-- This will avoid an annoying layout shift in the screen
|
|
vim.opt.signcolumn = "yes"
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
desc = "LSP actions",
|
|
callback = function(event)
|
|
local opts = { buffer = event.buf }
|
|
|
|
vim.keymap.set("n", "K", function()
|
|
vim.lsp.buf.hover()
|
|
end, opts)
|
|
vim.keymap.set("n", "gd", function()
|
|
vim.lsp.buf.definition()
|
|
end, opts)
|
|
vim.keymap.set("n", "gD", function()
|
|
vim.lsp.buf.declaration()
|
|
end, opts)
|
|
vim.keymap.set("n", "gi", function()
|
|
vim.lsp.buf.implementation()
|
|
end, opts)
|
|
vim.keymap.set("n", "go", function()
|
|
vim.lsp.buf.type_definition()
|
|
end, opts)
|
|
vim.keymap.set("n", "gr", function()
|
|
vim.lsp.buf.references()
|
|
end, opts)
|
|
vim.keymap.set("n", "gs", function()
|
|
vim.lsp.buf.signature_help()
|
|
end, opts)
|
|
vim.keymap.set("n", "<F2>", function()
|
|
vim.lsp.buf.rename()
|
|
end, opts)
|
|
vim.keymap.set({ "n", "x" }, "<F3>", function()
|
|
vim.lsp.buf.format({ async = true })
|
|
end, opts)
|
|
vim.keymap.set("n", "<leader>f", function()
|
|
vim.lsp.buf.code_action()
|
|
end, opts)
|
|
end,
|
|
})
|
|
|
|
load("mason-org/mason-lspconfig.nvim")
|
|
|
|
require("mason-lspconfig").setup({
|
|
automatic_enable = true,
|
|
})
|
|
|
|
load("LukasPietzschmann/boo.nvim")
|
|
end,
|
|
}
|