dotfiles/.config/nvim/lua/plugins/extras/lsp/actions-preview.lua
Sergio Laín 6b4097cb53
feat(nvim): added actions-preview and glance as lsp extras instead of dependencies
had a lot of trouble with the init function...
2023-11-26 13:33:48 +01:00

34 lines
743 B
Lua

return {
"aznhe21/actions-preview.nvim",
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = { "<leader>ca", false }
end,
event = "LspAttach",
opts = {
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
},
keys = {
{
"<leader>ca",
function()
require("actions-preview").code_actions()
end,
mode = { "n", "v" },
desc = "Code Action Preview",
},
},
}