Skip to content

Commit f716790

Browse files
authored
Merge pull request #325 from pranavrao145/docs/full-setup
docs(full-setup): added full setup function and all default values to README
2 parents 7328413 + 6c2820c commit f716790

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ are supported (with individual support for each function may vary):
103103
normal mode:
104104
- Using this function in visual mode will print out whatever is in the
105105
visual selection.
106-
- Setting `{ normal = true }` to the function will automatically find the variable
106+
- Passing `{ normal = true }` to the function will automatically find the variable
107107
under the cursor and print it from normal mode without needing visual mode at all
108108
- **Cleanup:** Automated cleanup of all print statements generated by the
109109
plugin
@@ -121,6 +121,37 @@ setup function.
121121
require('refactoring').setup({})
122122
```
123123

124+
Here are all the available options for the setup function and their defaults:
125+
126+
```lua
127+
require('refactoring').setup({
128+
prompt_func_return_type = {
129+
go = false,
130+
java = false,
131+
132+
cpp = false,
133+
c = false,
134+
h = false,
135+
hpp = false,
136+
cxx = false,
137+
},
138+
prompt_func_param_type = {
139+
go = false,
140+
java = false,
141+
142+
cpp = false,
143+
c = false,
144+
h = false,
145+
hpp = false,
146+
cxx = false,
147+
},
148+
printf_statements = {},
149+
print_var_statements = {},
150+
})
151+
```
152+
153+
See each of the sections below for details on each configuration option.
154+
124155
### Configuration for Refactoring Operations<a name="config-refactoring"></a>
125156

126157
#### Using Direct Remaps<a name="config-refactoring-direct"></a>
@@ -202,8 +233,8 @@ vim.api.nvim_set_keymap(
202233

203234
-- Print var
204235

205-
-- Remap in normal mode will automatically find the variable under the cursor and print it
206-
vim.api.nvim_set_keymap("n", "<leader>rv", ":lua require('refactoring').debug.print_var({})<CR>", { noremap = true })
236+
-- Remap in normal mode and passing { normal = true } will automatically find the variable under the cursor and print it
237+
vim.api.nvim_set_keymap("n", "<leader>rv", ":lua require('refactoring').debug.print_var({ normal = true })<CR>", { noremap = true })
207238
-- Remap in visual mode will print whatever is in the visual selection
208239
vim.api.nvim_set_keymap("v", "<leader>rv", ":lua require('refactoring').debug.print_var({})<CR>", { noremap = true })
209240

@@ -294,9 +325,5 @@ require('refactoring').setup({
294325
c = true,
295326
java = true,
296327
},
297-
-- custom print_var_statements by language
298-
print_var_statements = {}
299-
-- custom printf_statements by language
300-
printf_statements = {}
301328
})
302329
```

lua/refactoring/config/init.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ local default_formatting = {
2828

2929
local default_prompt_func_param_type = {
3030
go = false,
31+
java = false,
3132

32-
-- All of the cs
3333
cpp = false,
3434
c = false,
3535
h = false,
@@ -39,6 +39,13 @@ local default_prompt_func_param_type = {
3939

4040
local default_prompt_func_return_type = {
4141
go = false,
42+
java = false,
43+
44+
cpp = false,
45+
c = false,
46+
h = false,
47+
hpp = false,
48+
cxx = false,
4249
}
4350

4451
local default_printf_statements = {}

0 commit comments

Comments
 (0)