-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefactoring.lua
More file actions
60 lines (60 loc) · 1.74 KB
/
Copy pathrefactoring.lua
File metadata and controls
60 lines (60 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-- refactoring.nvim — language-aware extract/inline (C++, Python, Lua, ...).
-- select_refactor() routes through vim.ui.select → snacks. Keymaps under
-- <leader>r (group in whichkey.lua).
return {
"ThePrimeagen/refactoring.nvim",
-- 0.12 rewrite: only dep is async.nvim (dropped plenary; TS queries ship with
-- the plugin). setup() is optional but harmless.
dependencies = { "lewis6991/async.nvim" },
keys = {
{
"<leader>re",
function()
require("refactoring").refactor("Extract Function")
end,
mode = "x",
desc = "Extract function",
},
{
"<leader>rf",
function()
require("refactoring").refactor("Extract Function To File")
end,
mode = "x",
desc = "Extract function to file",
},
{
"<leader>rv",
function()
require("refactoring").refactor("Extract Variable")
end,
mode = "x",
desc = "Extract variable",
},
{
"<leader>ri",
function()
require("refactoring").refactor("Inline Variable")
end,
mode = { "n", "x" },
desc = "Inline variable",
},
{
"<leader>rb",
function()
require("refactoring").refactor("Extract Block")
end,
mode = "n",
desc = "Extract block",
},
{
"<leader>rr",
function()
require("refactoring").select_refactor()
end,
mode = { "n", "x" },
desc = "Select refactor",
},
},
opts = {},
}