我正在做一个Vimgolf问题来改变这个:
First:
Junk text.
Second:
Junk text.
Third:
Junk text.
Last:
Copy these lines,
and replace the text
in each heading above.
Run Code Online (Sandbox Code Playgroud)
对此:
First:
Copy these lines,
and replace the text
in each heading above.
Second:
Copy these lines,
and replace the text
in each heading above.
Third:
Copy these lines,
and replace the text
in each heading above.
Last:
Copy these lines,
and replace the text
in each heading above.
Run Code Online (Sandbox Code Playgroud)
一个解决方案是:
:8,$y<CR>:g/J/norm dd"0P<CR>ZZ
Run Code Online (Sandbox Code Playgroud)
在:g/J/norm dd"0P做什么?我知道"J"加入了行,":g"是全局的,但我不了解其余部分.
小智 6
分段:
"0P- 从寄存器0粘贴最初被拉出的行.如https://unix.stackexchange.com/a/26716中所述dd - 删除当前行因此,这将替换当前行与被阻止的块.
| 归档时间: |
|
| 查看次数: |
60 次 |
| 最近记录: |