local refactoring = require('refactoring') refactoring.setup({}) -- Use which-key to register the mapping explicitly local wk = require("which-key") -- We use Ex commands (e.g., ":Refactor extract ") because they provide a live preview -- and automatically handle visual mode bounds without needing expr=true hacks. wk.add({ { "r", group = "refactor" }, { mode = { "x", "n" }, { "rm", function() require('refactoring').select_refactor() end, desc = "Refactor Menu" }, { "re", ":Refactor extract ", desc = "Extract Function" }, { "rf", ":Refactor extract_to_file ", desc = "Extract Function To File" }, { "rv", ":Refactor extract_var ", desc = "Extract Variable" }, { "ri", ":Refactor inline_var", desc = "Inline Variable" }, { "rI", ":Refactor inline_func", desc = "Inline Function" }, { "rb", ":Refactor extract_block", desc = "Extract Block" }, { "rbf", ":Refactor extract_block_to_file", desc = "Extract Block To File" }, }, })