1
1
==============================================================================
2
2
------------------------------------------------------------------------------
3
- *TextTransform .init_commands()*
4
- `TextTransform .init_commands` ()
3
+ *commands .init_commands()*
4
+ `commands .init_commands` ()
5
5
Initializes user commands
6
6
@private
7
7
8
+ ------------------------------------------------------------------------------
9
+ *commands.init_keymaps()*
10
+ `commands.init_keymaps` ()
11
+ Initializes user keymaps
12
+ @private
13
+
8
14
9
15
==============================================================================
10
16
------------------------------------------------------------------------------
11
- *TextTransform .config*
12
- `TextTransform .config`
17
+ *config .config*
18
+ `config .config`
13
19
Your plugin configuration with its default values.
14
20
15
21
Default values:
16
22
>
17
- TextTransform .config = {
23
+ config .config = {
18
24
--- Prints information about internals of the plugin. Very verbose, only useful for debugging.
19
25
debug = false,
20
26
--- Keymap configurations
@@ -55,13 +61,8 @@ Default values:
55
61
<
56
62
57
63
------------------------------------------------------------------------------
58
- *init()*
59
- `init` ()
60
- @internal
61
-
62
- ------------------------------------------------------------------------------
63
- *TextTransform.setup()*
64
- `TextTransform.setup` ({options} )
64
+ *config.setup()*
65
+ `config.setup` ({options} )
65
66
Define your text-transform setup.
66
67
67
68
Parameters ~
@@ -81,8 +82,20 @@ Finds the boundaries of the surrounding word around `start_col` within `line`.
81
82
@return number start_col, number end_col
82
83
83
84
------------------------------------------------------------------------------
84
- *TextTransform.replace_word()*
85
- `TextTransform.replace_word` ({transform_name}, {position} )
85
+ *replacers.replace_range()*
86
+ `replacers.replace_range` ({start_line}, {start_col}, {end_line}, {end_col}, {transform_name})
87
+ Replace the range between the given positions with the given transform.
88
+ Acts on the lines between the given positions, replacing the text between the given columns.
89
+
90
+ @param start_line number The starting line
91
+ @param start_col number The starting column
92
+ @param end_line number The ending line
93
+ @param end_col number The ending column
94
+ @param transform_name string The transformer name
95
+
96
+ ------------------------------------------------------------------------------
97
+ *replacers.replace_word()*
98
+ `replacers.replace_word` ({transform_name}, {position} )
86
99
Replace the word under the cursor with the given transform.
87
100
If `position` is provided, replace the word under the given position.
88
101
Otherwise, attempts to find the word under the cursor.
@@ -91,23 +104,25 @@ Otherwise, attempts to find the word under the cursor.
91
104
@param position table|nil A table containing the position of the word to replace
92
105
93
106
------------------------------------------------------------------------------
94
- *TextTransform .replace_columns()*
95
- `TextTransform .replace_columns` ({transform_name})
107
+ *replacers .replace_columns()*
108
+ `replacers .replace_columns` ({transform_name})
96
109
Replaces each column in visual block mode selection with the given transform.
97
110
Assumes that the each selection is 1 character and operates on the whole word under each cursor.
98
111
112
+ @param transform_name string The transformer name
113
+
99
114
------------------------------------------------------------------------------
100
- *TextTransform .replace_selection()*
101
- `TextTransform .replace_selection` ({transform_name})
115
+ *replacers .replace_selection()*
116
+ `replacers .replace_selection` ({transform_name})
102
117
Replaces a selection with the given transform. This function attempts to infer the replacement
103
118
type based on the cursor positiono and visual selections, and passes information to relevant
104
119
range replacement functions.
105
120
106
121
@param transform_name string The transformer name
107
122
108
123
------------------------------------------------------------------------------
109
- *TextTransform .get_visual_selection_details()*
110
- `TextTransform .get_visual_selection_details` ()
124
+ *replacers .get_visual_selection_details()*
125
+ `replacers .get_visual_selection_details` ()
111
126
Takes the saved positions and translates them into individual visual ranges, regardless of how
112
127
the original selection was performed.
113
128
@@ -116,23 +131,10 @@ the full information around the selection logic.
116
131
117
132
118
133
==============================================================================
119
- ------------------------------------------------------------------------------
120
- *state.toggle()*
121
- `state .toggle` ()
122
- Toggle the plugin by calling the `enable ` /`disable` methods respectively.
123
- @private
124
-
125
- ------------------------------------------------------------------------------
126
- *state.enable()*
127
- `state .enable ` ()
128
- Enables the plugin
129
- @private
130
-
131
134
------------------------------------------------------------------------------
132
135
*state.save_positions()*
133
136
`state .save_positions` ()
134
137
Save the current cursor position, mode, and visual selection ranges
135
- @private
136
138
137
139
------------------------------------------------------------------------------
138
140
*state.restore_positions()*
@@ -143,27 +145,15 @@ or a given modified state, if passed as the first argument
143
145
144
146
==============================================================================
145
147
------------------------------------------------------------------------------
146
- *telescope.telescope_popup()*
147
- `telescope.telescope_popup` ()
148
- Pops up a telescope menu, containing the available case transformers.
149
- When a transformer is selected, the cursor position/range/columns will be used to replace the
150
- words around the cursor or inside the selection.
151
-
152
- The cursor positions/ranges are saved before opening the menu and restored once a selection is
153
- made.
154
-
155
-
156
- ==============================================================================
157
- ------------------------------------------------------------------------------
158
- *TextTransform.to_words()*
159
- `TextTransform.to_words` ({string} )
148
+ *transformers.to_words()*
149
+ `transformers.to_words` ({string} )
160
150
Splits a string into words.
161
151
@param string string
162
152
@return table
163
153
164
154
------------------------------------------------------------------------------
165
- *TextTransform .transform_words()*
166
- `TextTransform .transform_words` ({words} , {with_word_cb}, {separator} )
155
+ *transformers .transform_words()*
156
+ `transformers .transform_words` ({words} , {with_word_cb}, {separator} )
167
157
Transforms a table of strings into a string using a callback and separator.
168
158
The callback is called with the word, the index, and the table of words.
169
159
The separator is added between each word.
@@ -174,55 +164,91 @@ The separator is added between each word.
174
164
@return string
175
165
176
166
------------------------------------------------------------------------------
177
- *TextTransform .to_camel_case()*
178
- `TextTransform .to_camel_case` ({string} )
167
+ *transformers .to_camel_case()*
168
+ `transformers .to_camel_case` ({string} )
179
169
Transforms a string into camelCase.
180
170
@param string string
181
171
@return string
182
172
183
173
------------------------------------------------------------------------------
184
- *TextTransform .to_snake_case()*
185
- `TextTransform .to_snake_case` ({string} )
174
+ *transformers .to_snake_case()*
175
+ `transformers .to_snake_case` ({string} )
186
176
Transfroms a string into snake_case.
187
177
@param string any
188
178
@return string
189
179
190
180
------------------------------------------------------------------------------
191
- *TextTransform .to_pascal_case()*
192
- `TextTransform .to_pascal_case` ({string} )
181
+ *transformers .to_pascal_case()*
182
+ `transformers .to_pascal_case` ({string} )
193
183
Transforms a string into PascalCase.
194
184
@param string string
195
185
@return string
196
186
197
187
------------------------------------------------------------------------------
198
- *TextTransform .to_title_case()*
199
- `TextTransform .to_title_case` ({string} )
188
+ *transformers .to_title_case()*
189
+ `transformers .to_title_case` ({string} )
200
190
Transforms a string into Title Case.
201
191
@param string string
202
192
@return string
203
193
204
194
------------------------------------------------------------------------------
205
- *TextTransform .to_kebab_case()*
206
- `TextTransform .to_kebab_case` ({string} )
195
+ *transformers .to_kebab_case()*
196
+ `transformers .to_kebab_case` ({string} )
207
197
Transforms a string into kebab-case.
208
198
@param string string
209
199
@return string
210
200
211
201
------------------------------------------------------------------------------
212
- *TextTransform .to_dot_case()*
213
- `TextTransform .to_dot_case` ({string} )
202
+ *transformers .to_dot_case()*
203
+ `transformers .to_dot_case` ({string} )
214
204
Transforms a string into dot.case.
215
205
@param string string
216
206
@return string
217
207
218
208
------------------------------------------------------------------------------
219
- *TextTransform .to_const_case()*
220
- `TextTransform .to_const_case` ({string} )
209
+ *transformers .to_const_case()*
210
+ `transformers .to_const_case` ({string} )
221
211
Transforms a string into CONSTANT_CASE.
222
212
@param string string
223
213
@return string
224
214
225
215
216
+ ==============================================================================
217
+ ------------------------------------------------------------------------------
218
+ *popup.show_popup()*
219
+ `popup .show_popup` ()
220
+ Pops up a selection menu, containing the available case transformers.
221
+ When a transformer is selected, the cursor position/range/columns will be used to replace the
222
+ words around the cursor or inside the selection.
223
+
224
+ The cursor positions/ranges are saved before opening the menu and restored once a selection is
225
+ made.
226
+
227
+
228
+ ==============================================================================
229
+ ------------------------------------------------------------------------------
230
+ *select.select_popup()*
231
+ `select.select_popup` ()
232
+ Pops up a selection menu, containing the available case transformers.
233
+ When a transformer is selected, the cursor position/range/columns will be used to replace the
234
+ words around the cursor or inside the selection.
235
+
236
+ The cursor positions/ranges are saved before opening the menu and restored once a selection is
237
+ made.
238
+
239
+
240
+ ==============================================================================
241
+ ------------------------------------------------------------------------------
242
+ *telescope.telescope_popup()*
243
+ `telescope.telescope_popup` ()
244
+ Pops up a telescope menu, containing the available case transformers.
245
+ When a transformer is selected, the cursor position/range/columns will be used to replace the
246
+ words around the cursor or inside the selection.
247
+
248
+ The cursor positions/ranges are saved before opening the menu and restored once a selection is
249
+ made.
250
+
251
+
226
252
==============================================================================
227
253
------------------------------------------------------------------------------
228
254
*utils.merge()*
@@ -236,12 +262,5 @@ TODO accept multiple tables to merge
236
262
@param t2 table
237
263
@return table
238
264
239
- ------------------------------------------------------------------------------
240
- *utils.dump()*
241
- `utils.dump` ({obj} )
242
- Dumps the object into a string.
243
- @param obj any
244
- @return string
245
-
246
265
247
266
vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments