diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2933f48..21ac9f4 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "LuaSnip": { "branch": "master", "commit": "659c4479529a05cc9b05ef762639a09d366cc690" }, "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, + "actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "base46": { "branch": "v2.5", "commit": "16ee0e93dfc52e35ee7c9cf45e5ebf116958edb7" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 97de13a..c3bb46b 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -32,7 +32,7 @@ map( " lua require('conform').format { lsp_fallback = true }", { desc = "General Format file" } ) -map({ "n", "v" }, "la", vim.lsp.buf.code_action, { desc = "Code action" }) +map({ "n", "v" }, "la", require("actions-preview").code_actions, { desc = "Code action" }) map("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" }) map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) diff --git a/nvim/lua/plugins/action-preview.lua b/nvim/lua/plugins/action-preview.lua new file mode 100644 index 0000000..95ccfce --- /dev/null +++ b/nvim/lua/plugins/action-preview.lua @@ -0,0 +1,20 @@ +return { + "aznhe21/actions-preview.nvim", + opts = { + backend = { "telescope", "nui" }, + telescope = vim.tbl_extend( + "force", + -- telescope theme: https://github.com/nvim-telescope/telescope.nvim#themes + require("telescope.themes").get_cursor(), + { + make_value = nil, + make_make_display = nil, + previewer = false, + layout_config = { + width = 0.2, + height = 0.1, + }, + } + ), + } +};