.config/nvim/lua/config/maps.lua

changeset 1152
59d9ca2ec2fd
parent 1149
4af7c8156683
child 1153
57809d2642ff
--- a/.config/nvim/lua/config/maps.lua
+++ b/.config/nvim/lua/config/maps.lua
@@ -88,18 +88,22 @@ vim.api.nvim_create_autocmd("LspAttach",
     map("n", "gd", vim.lsp.buf.definition, bufopts)
     map("n", "K", vim.lsp.buf.hover, bufopts)
     map("n", "gi", vim.lsp.buf.implementation, bufopts)
-    map("n", "<F12>", vim.lsp.buf.signature_help, bufopts)
+    map("n", "<C-S>", vim.lsp.buf.signature_help, bufopts)
     map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
     map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
     map("n", "<leader>wl", function()
       print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
     end, bufopts)
     map("n", "<leader>D", vim.lsp.buf.type_definition, bufopts)
-    map("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
-    -- map("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
+    map("n", "crn", vim.lsp.buf.rename, bufopts)
     map("n", "gr", vim.lsp.buf.references, bufopts)
     map({ "n", "x" }, "<leader>f", function()
       vim.lsp.buf.format({ async = true })
     end, bufopts)
+
+    local code_actions = require("actions-preview").code_actions
+    map("n", "crr", code_actions, bufopts)
+    map("x", "<C-R><C-R>", code_actions, bufopts)
+    map("x", "<C-R>", code_actions, bufopts)
   end,
 })

mercurial