-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreword.txt
103 lines (79 loc) · 2.93 KB
/
reword.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
*reword.txt* Rewords by case preserving substitutions
Author: Alisue <lambdalisue@hashnote.net>
License: MIT license
=============================================================================
CONTENTS *reword-contents*
INTRODUCTION |reword-introduction|
USAGE |reword-usage|
INTERFACE |reword-interface|
VARIABLE |reword-variable|
COMMAND |reword-command|
FUNCTION |reword-function|
=============================================================================
INTRODUCTION *reword-introduction*
*reword.vim* (reword) is a plugin to reword in case preserving manner.
=============================================================================
USAGE *reword-usage*
Use |:Reword| command to replace the first word in a current line like:
>
:Reword/HelloWorld/FooBarHoge
<
And use "g" flags to replace all words in a current line like:
>
:Reword/HelloWorld/FooBarHoge/g
<
Prepend "%" to replace all words in a buffer like:
>
:%Reword/HelloWorld/FooBarHoge/g
<
Note that the following substitutions will be applied as well with
|:Reword| command:
Name From To Disable flag~
lowerCamelCase helloWorld fooBarHoge l
snake_case hello_world foo_bar_hoge s
kebab-case hello-world foo-bar-hoge k
lower helloworld foobarhoge i
UPPER HELLOWORLD FOOBARHOGE i
Use above disable flags to disable each cases.
=============================================================================
INTERFACE *reword-interface*
-----------------------------------------------------------------------------
VARIABLE *reword-variable*
*g:reword_disable_live*
Set 1 to disable live preview. Use it with |reword#live#start()| to
define non default abbreviations.
Default: 0
-----------------------------------------------------------------------------
COMMAND *reword-command*
*:Reword*
:[range]Reword/{old}/{new}/[flags]
Substitute {old} in the current buffer to {new}. The {old} must be
written in UpperCamelCase then corresponding cases of the {old} will
be substituted.
Note that the following additional {flags} are available
l Disable lowerCamelCase substitution
s Disable snake_case substitution
k Disable kebab-case substitution
i Disable case insensitive substitution
Example:
>
:%Reword/HelloWorld/FooBarHoge/g
<
Note that the delimiter can be any non word character as like
|:substitute| command.
>
:%Reword!HelloWorld!FooBarHoge!g
<
Note that patterns in {old} or {new} are escaped prior to substitute.
-----------------------------------------------------------------------------
FUNCTION *reword-function*
*reword#live#start()*
reword#live#start()
An abbreviation function to start live preview.
Use it with |cnoreabbrev| and |map-<expr>| like:
>
cnoreabbrev <expr> Reword reword#live#start()
<
Then the live preview starts when user hit Reword{delimiter}.
=============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl