{...}: { programs.nixvim = { plugins = { refactoring = { enable = true; }; telescope.enabledExtensions = ["refactoring"]; which-key.settings.spec = [ { __unkeyed = "r"; mode = "x"; group = " Refactor"; } ]; }; keymaps = [ { mode = "x"; key = "re"; action = ":Refactor extract "; options = { desc = "Extract"; silent = true; }; } { mode = "x"; key = "rE"; action = ":Refactor extract_to_file "; options = { desc = "Extract to file"; silent = true; }; } { mode = "x"; key = "rv"; action = ":Refactor extract_var "; options = { desc = "Extract var"; silent = true; }; } { mode = "n"; key = "ri"; action = ":Refactor inline_var"; options = { desc = "Inline var"; silent = true; }; } { mode = "n"; key = "rI"; action = ":Refactor inline_func"; options = { desc = "Inline Func"; silent = true; }; } { mode = "n"; key = "rb"; action = ":Refactor extract_block"; options = { desc = "Extract block"; silent = true; }; } { mode = "n"; key = "rB"; action = ":Refactor extract_block_to_file"; options = { desc = "Extract block to file"; silent = true; }; } { mode = "n"; key = "fR"; action.__raw = # lua '' function() require('telescope').extensions.refactoring.refactors() end ''; options = { desc = "Refactoring"; silent = true; }; } ]; }; }