Added actions preview plugin

This commit is contained in:
Dreaded_X 2025-06-03 03:40:17 +02:00
parent b4dfc6cfc0
commit 535ad35ded
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA
3 changed files with 32 additions and 1 deletions

View File

@ -1,5 +1,6 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"actions-preview.nvim": { "branch": "master", "commit": "36513ad213855d497b7dd3391a24d1d75d58e36f" },
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },

View File

@ -27,7 +27,9 @@ map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, "Toggle inlay hints")
map("gra", vim.lsp.buf.code_action, "Code actions", { "n", "x" })
map("gra", function()
require("actions-preview").code_actions()
end, "Code actions", { "n", "x" })
map("grD", vim.lsp.buf.declaration, "Goto declaration")
map("grd", function()
require("telescope.builtin").lsp_definitions({ jump_type = "never" })

View File

@ -0,0 +1,28 @@
-- https://github.com/aznhe21/actions-preview.nvim
--- @module "lazy"
--- @type LazySpec
return {
"aznhe21/actions-preview.nvim",
opts = function()
local hl = require("actions-preview.highlight")
return {
backend = { "telescope" },
highlight_command = {
hl.delta(),
},
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,
},
},
}
end,
}