diff --git a/flake.lock b/flake.lock index 3981302..e54775f 100644 --- a/flake.lock +++ b/flake.lock @@ -144,6 +144,22 @@ "type": "github" } }, + "nvim_plugin-aznhe21/actions-preview.nvim": { + "flake": false, + "locked": { + "lastModified": 1718540350, + "narHash": "sha256-lYjsv8y1fMuTGpBF/iG7cm/a7tLdh748vJhVsSp/Iz8=", + "owner": "aznhe21", + "repo": "actions-preview.nvim", + "rev": "9f52a01c374318e91337697ebed51c6fae57f8a4", + "type": "github" + }, + "original": { + "owner": "aznhe21", + "repo": "actions-preview.nvim", + "type": "github" + } + }, "nvim_plugin-b0o/schemastore.nvim": { "flake": false, "locked": { @@ -875,6 +891,7 @@ "nvim_plugin-MunifTanjim/nui.nvim": "nvim_plugin-MunifTanjim/nui.nvim", "nvim_plugin-RRethy/vim-illuminate": "nvim_plugin-RRethy/vim-illuminate", "nvim_plugin-Saecki/crates.nvim": "nvim_plugin-Saecki/crates.nvim", + "nvim_plugin-aznhe21/actions-preview.nvim": "nvim_plugin-aznhe21/actions-preview.nvim", "nvim_plugin-b0o/schemastore.nvim": "nvim_plugin-b0o/schemastore.nvim", "nvim_plugin-catppuccin/nvim": "nvim_plugin-catppuccin/nvim", "nvim_plugin-chrisgrieser/nvim-early-retirement": "nvim_plugin-chrisgrieser/nvim-early-retirement", diff --git a/flake.nix b/flake.nix index 93c5ea8..3736af8 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,8 @@ "nvim_plugin-nvim-telescope/telescope-fzf-native.nvim".flake = false; # fzf integration for telescope "nvim_plugin-nvim-telescope/telescope-ui-select.nvim".url = "github:nvim-telescope/telescope-ui-select.nvim"; "nvim_plugin-nvim-telescope/telescope-ui-select.nvim".flake = false; # telescope used for selections in ui + "nvim_plugin-aznhe21/actions-preview.nvim".url = "github:aznhe21/actions-preview.nvim"; + "nvim_plugin-aznhe21/actions-preview.nvim".flake = false; # telescope used for code action diffs in ui "nvim_plugin-nvim-telescope/telescope-file-browser.nvim".url = "github:nvim-telescope/telescope-file-browser.nvim"; "nvim_plugin-nvim-telescope/telescope-file-browser.nvim".flake = false; # telescope based file browser "nvim_plugin-nvim-tree/nvim-tree.lua".url = "github:nvim-tree/nvim-tree.lua"; diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 59eb7b3..42ce618 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -51,7 +51,14 @@ return { map("gr", require("telescope.builtin").lsp_references, "Goto References") map("gI", require("telescope.builtin").lsp_implementations, "Goto Implementation") map("lr", vim.lsp.buf.rename, "Rename") - map("la", vim.lsp.buf.code_action, "Code Action") + -- map("la", vim.lsp.buf.code_action, "Code Action") + map("la", function() + U.safeRequire("actions-preview", function() + require("actions-preview").code_actions() + end, function() + vim.lsp.buf.code_action() + end) + end, "Code Action") map("K", vim.lsp.buf.hover, "Hover Documentation") map("gD", vim.lsp.buf.declaration, "Goto Declaration") end, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index d37cdf2..dbf5dfe 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -4,6 +4,7 @@ return { { "nvim-lua/plenary.nvim" }, { "nvim-telescope/telescope-fzf-native.nvim", event = "VeryLazy" }, { "nvim-telescope/telescope-ui-select.nvim", event = "VeryLazy" }, + { "aznhe21/actions-preview.nvim", event = "VeryLazy" }, }, init = function() U.cmd_executable("rg", {