我有一些文本行,如下所示
text1
text1
text1
text1
Run Code Online (Sandbox Code Playgroud)
我想把它们改成
text1
text2
text3
text4
Run Code Online (Sandbox Code Playgroud)
在gvim中有一个简单的方法吗?我知道使用ctrl + v的可视块可以用其他字母替换一个字母.但我不知道如何生成序列号.
帮助赞赏.谢谢
您可以从第二行开始选择文本,然后使用g<ctrl-a>.
来自:h v_g_CTRL-A:
*v_g_CTRL-A*
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
the highlighted text. If several lines are
highlighted, each one will be incremented by an
additional [count] (so effectively creating a
[count] incrementing sequence). {not in Vi}
For Example, if you have this list of numbers:
1.
1.
1.
1.
Move to the second "1." and Visually select three
lines, pressing g CTRL-A results in:
1.
2.
3.
4.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
175 次 |
| 最近记录: |