在这一系列的Vim命令中,norm dd“0P是什么?

时间:2016-09-23 18:28:10

标签: vim

我正在做一个Vimgolf问题来改变这个:

First:
        Junk text.
Second:
        Junk text.
Third:
        Junk text.
Last:
        Copy these lines,
        and replace the text
        in each heading above.

到此:

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.

一个解决方案是:

:8,$y<CR>:g/J/norm dd"0P<CR>ZZ

:g/J/norm dd"0P在做什么?我知道“J”加入了行,“:g”是全局的,但我不了解其余部分。

1 个答案:

答案 0 :(得分:6)

By pieces:

所以这会将当前行替换为yanked块。