Vim : How to add a new line

I want to add a line break in vim from line 59 to the end of file.

- 0021: Paralleism
- 0022: Mazimum Sum Sequence
- 0023: Circles Intersection
- 0024: Physical Experiments

to this

- 0021: Paralleism

- 0022: Mazimum Sum Sequence

- 0023: Circles Intersection

- 0024: Physical Experiments

I tried the following but it doesn't work.

:59,Gs/$/$n/

How can I achieve this with vim substitute?


你应该能够完成它:

:59,$s/$/r/

Another way to do this would be:

:59,$g/./norm o

Alternatively if you wanted to do this to all lines beginning with a - you could do:

:g/- /norm o

Time for global:

:59,$g/^/pu_

For more see:

:h :g
:h :pu
:h registers
链接地址: http://www.djcxy.com/p/49334.html

上一篇: 从vim中的寄存器中删除换行符?

下一篇: Vim:如何添加一个新行