@@ -17,37 +17,37 @@ They are only shown here for reference.
1717import Tabs from '@theme/Tabs ';
1818import TabItem from '@theme/TabItem ';
1919
20+ ## [ async.nvim] ( https://github.com/lewis6991/async.nvim )
21+
22+ <Tabs >
23+
24+ <TabItem value =" opts " label =" Options " >
25+
26+ ``` lua
27+ opts = nil
28+ ```
29+
30+ </TabItem >
31+
32+
33+ <TabItem value =" code " label =" Full Spec " >
34+
35+ ``` lua
36+ { " lewis6991/async.nvim" , lazy = true }
37+ ```
38+
39+ </TabItem >
40+
41+ </Tabs >
42+
2043## [ refactoring.nvim] ( https://github.com/ThePrimeagen/refactoring.nvim )
2144
2245<Tabs >
2346
2447<TabItem value =" opts " label =" Options " >
2548
2649``` lua
27- opts = {
28- prompt_func_return_type = {
29- go = false ,
30- java = false ,
31- cpp = false ,
32- c = false ,
33- h = false ,
34- hpp = false ,
35- cxx = false ,
36- },
37- prompt_func_param_type = {
38- go = false ,
39- java = false ,
40- cpp = false ,
41- c = false ,
42- h = false ,
43- hpp = false ,
44- cxx = false ,
45- },
46- printf_statements = {},
47- print_var_statements = {},
48- show_success_message = true , -- shows a message with information about the refactor on success
49- -- i.e. [Refactor] Inlined 3 variable occurrences
50- }
50+ opts = {}
5151```
5252
5353</TabItem >
@@ -59,71 +59,54 @@ opts = {
5959{
6060 " ThePrimeagen/refactoring.nvim" ,
6161 event = { " BufReadPre" , " BufNewFile" },
62- dependencies = {
63- " nvim-lua/plenary.nvim" ,
64- " nvim-treesitter/nvim-treesitter" ,
65- },
6662 keys = {
6763 { " <leader>r" , " " , desc = " +refactor" , mode = { " n" , " x" } },
6864 {
6965 " <leader>rs" ,
70- pick ,
71- mode = { " n" , " x" },
72- desc = " Refactor" ,
73- },
74- {
75- " <leader>ri" ,
76- function ()
77- return require (" refactoring" ).refactor (" Inline Variable" )
78- end ,
79- mode = { " n" , " x" },
80- desc = " Inline Variable" ,
81- expr = true ,
82- },
83- {
84- " <leader>rb" ,
8566 function ()
86- return require (" refactoring" ).refactor ( " Extract Block " )
67+ return require (" refactoring" ).select_refactor ( )
8768 end ,
8869 mode = { " n" , " x" },
89- desc = " Extract Block" ,
90- expr = true ,
70+ desc = " Select Refactor" ,
9171 },
9272 {
93- " <leader>rf " ,
73+ " <leader>ri " ,
9474 function ()
95- return require (" refactoring" ).refactor ( " Extract Block To File " )
75+ return require (" refactoring" ).inline_var ( )
9676 end ,
9777 mode = { " n" , " x" },
98- desc = " Extract Block To File " ,
78+ desc = " Inline Variable " ,
9979 expr = true ,
10080 },
10181 {
10282 " <leader>rP" ,
10383 function ()
104- require (" refactoring" ).debug . printf ({ below = false })
84+ return require (" refactoring.debug " ).print_loc ({ output_location = " below " })
10585 end ,
106- desc = " Debug Print" ,
86+ desc = " Debug Print Location" ,
87+ expr = true ,
10788 },
10889 {
10990 " <leader>rp" ,
11091 function ()
111- require (" refactoring" ).debug . print_var ({ normal = true })
92+ return require (" refactoring.debug " ).print_var ({ output_location = " below " }) .. " iw "
11293 end ,
11394 mode = { " n" , " x" },
11495 desc = " Debug Print Variable" ,
96+ expr = true ,
11597 },
11698 {
11799 " <leader>rc" ,
118100 function ()
119- require (" refactoring" ).debug . cleanup ({})
101+ return require (" refactoring.debug " ).cleanup ({ restore_view = true }) .. " ag "
120102 end ,
121103 desc = " Debug Cleanup" ,
104+ expr = true ,
122105 },
123106 {
124107 " <leader>rf" ,
125108 function ()
126- return require (" refactoring" ).refactor ( " Extract Function " )
109+ return require (" refactoring" ).extract_func ( )
127110 end ,
128111 mode = { " n" , " x" },
129112 desc = " Extract Function" ,
@@ -132,7 +115,7 @@ opts = {
132115 {
133116 " <leader>rF" ,
134117 function ()
135- return require (" refactoring" ).refactor ( " Extract Function To File " )
118+ return require (" refactoring" ).extract_func_to_file ( )
136119 end ,
137120 mode = { " n" , " x" },
138121 desc = " Extract Function To File" ,
@@ -141,107 +124,19 @@ opts = {
141124 {
142125 " <leader>rx" ,
143126 function ()
144- return require (" refactoring" ).refactor ( " Extract Variable " )
127+ return require (" refactoring" ).extract_var ( )
145128 end ,
146129 mode = { " n" , " x" },
147130 desc = " Extract Variable" ,
148131 expr = true ,
149132 },
150- {
151- " <leader>rp" ,
152- function ()
153- require (" refactoring" ).debug .print_var ()
154- end ,
155- mode = { " n" , " x" },
156- desc = " Debug Print Variable" ,
157- },
158- },
159- opts = {
160- prompt_func_return_type = {
161- go = false ,
162- java = false ,
163- cpp = false ,
164- c = false ,
165- h = false ,
166- hpp = false ,
167- cxx = false ,
168- },
169- prompt_func_param_type = {
170- go = false ,
171- java = false ,
172- cpp = false ,
173- c = false ,
174- h = false ,
175- hpp = false ,
176- cxx = false ,
177- },
178- printf_statements = {},
179- print_var_statements = {},
180- show_success_message = true , -- shows a message with information about the refactor on success
181- -- i.e. [Refactor] Inlined 3 variable occurrences
182133 },
183- config = function (_ , opts )
184- require (" refactoring" ).setup (opts )
185- if LazyVim .has (" telescope.nvim" ) then
186- LazyVim .on_load (" telescope.nvim" , function ()
187- require (" telescope" ).load_extension (" refactoring" )
188- end )
189- end
190- end ,
191- }
192- ```
193-
194- </TabItem >
195-
196- </Tabs >
197-
198- ## [ plenary.nvim] ( https://github.com/nvim-lua/plenary.nvim )
199-
200- <Tabs >
201-
202- <TabItem value =" opts " label =" Options " >
203-
204- ``` lua
205- opts = nil
206- ```
207-
208- </TabItem >
209-
210-
211- <TabItem value =" code " label =" Full Spec " >
212-
213- ``` lua
214- {
215- " nvim-lua/plenary.nvim" ,
216- " nvim-treesitter/nvim-treesitter" ,
134+ opts = {},
217135}
218136```
219137
220138</TabItem >
221139
222140</Tabs >
223141
224- ## [ nvim-treesitter] ( https://github.com/nvim-treesitter/nvim-treesitter )
225-
226- <Tabs >
227-
228- <TabItem value =" opts " label =" Options " >
229-
230- ``` lua
231- opts = nil
232- ```
233-
234- </TabItem >
235-
236-
237- <TabItem value =" code " label =" Full Spec " >
238-
239- ``` lua
240- " nvim-treesitter/nvim-treesitter"
241- ```
242-
243- </TabItem >
244-
245- </Tabs >
246-
247142<!-- plugins:end -->
0 commit comments