如何解读这个VimGolf的答案?

che*_*ren 0 vim

VimGolf的挑战

从:

Make the pairs of lines match up by making each second line same as first:

# Appending text:
The name "Vim" is an acronym for "Vi IMproved"
The name "Vim" is an acronym for

# Editing text:
Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga
Trivia: Vim is a text editor released by Bram Moolenaar in 1991 for the Amiga

# Deleting text:
Vim has a vi compatibility mode
Vim has a vi compatibility mode but when not in this mode Vim has many enhancements over vi
Run Code Online (Sandbox Code Playgroud)

至:

Make the pairs of lines match up by making each second line same as first:

# Appending text:
The name "Vim" is an acronym for "Vi IMproved"
The name "Vim" is an acronym for "Vi IMproved"

# Editing text:
Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga
Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga

# Deleting text:
Vim has a vi compatibility mode
Vim has a vi compatibility mode
Run Code Online (Sandbox Code Playgroud)

需要最少击键的最佳答案之一是:

:g/v/t.|+d<CR>ZZ

我试图理解为什么这项工作.是什么意思v,.,|在这种情况下?此外,我在哪里可以找到相关部分:help

谢谢.

rom*_*inl 5

:g/v/command
Run Code Online (Sandbox Code Playgroud)

command在每一行匹配上执行v.

:t.
Run Code Online (Sandbox Code Playgroud)

将当前行复制到自身下方.

之后,删除原始的"第二行".

简而言之,该解决方案的作者开箱即用:不是操纵第二行,而是简单地复制第一行并删除第二行.

至于文件:

:help :g
:help :t
Run Code Online (Sandbox Code Playgroud)