最后活跃于 1752256696

javif89's Avatar javif89 修订了这个 Gist 1752256695. 转到此修订

没有任何变更

javif89's Avatar javif89 修订了这个 Gist 1752256112. 转到此修订

1 file changed, 29 insertions

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=`
上一页 下一页