README.md(文件已创建)
@@ -0,0 +1,29 @@ | |||
1 | + | # How to use the one-eye kirby in vim | |
2 | + | ||
3 | + | This is the easiest way to manipulate multiple lines of text with vim motions. | |
4 | + | ||
5 | + | ## Example | |
6 | + | ||
7 | + | Say you have this in your .env | |
8 | + | ||
9 | + | ``` | |
10 | + | LOG_CHANNEL=stack | |
11 | + | LOG_STACK=single | |
12 | + | LOG_DEPRECATIONS_CHANNEL=null | |
13 | + | LOG_LEVEL=debug | |
14 | + | ``` | |
15 | + | ||
16 | + | And you want to turn it into | |
17 | + | ||
18 | + | ``` | |
19 | + | APP_LOG_CHANNEL=stack | |
20 | + | APP_LOG_STACK=single | |
21 | + | APP_LOG_DEPRECATIONS_CHANNEL=null | |
22 | + | APP_LOG_LEVEL=debug | |
23 | + | ``` | |
24 | + | ||
25 | + | 1. Select the lines you want to manipulate | |
26 | + | 2. Run `:s/(.*)=` (you might have to \ escape the ( depending on your editor) | |
27 | + | 3. Now everything before the `=` is your *capturing group* 1. You can have as many capture groups as you want. | |
28 | + | 4. Now as part of the same expression you can do `APP_\1=` | |
29 | + | 5. Final expression is `:s/(.*)=/APP_\1=` |
上一页
下一页