Refactoring Extra
editor.refactoring installs
refactoring.nvim, a
Treesitter-powered refactoring helper for extracting, inlining, and print-debug
workflows.
Enable it
Section titled “Enable it”return { extras = { enabled = { "editor.refactoring", }, },}Because this extra adds a plugin, run:
:BlakExtras syncWhat it adds
Section titled “What it adds”| Surface | Contribution |
|---|---|
| Plugin | ThePrimeagen/refactoring.nvim |
| Dependencies | plenary.nvim, nvim-treesitter |
| Keymap | <leader>re extracts a function |
| Keymap | <leader>rf extracts a function to a file |
| Keymap | <leader>rv extracts a variable |
| Keymap | <leader>ri inlines a variable |
| Keymap | <leader>rI inlines a function |
| Keymap | <leader>rp inserts a print-debug statement |
| Keymap | <leader>rc cleans up print-debug statements |
The keymaps appear in :BlakKeys.
Most refactors are visual-mode actions because they operate on a selected code range.