The first one is:
.,+15s/first/second/g
I know that the . simply repeats the last operation but i'm not familiar with the rest of it. The other vi command I would like to know is:
10yy (followed by) p
The first command replaces (s
) all occurences (g
) of first
with second
in the current (.
) and the next 15 (+15
) lines. It is supposed to be entered in vim
's command line, which can be opened using :. For more information about replacing, see the vim wiki.
The second command copies (yy
) 10 lines, starting from the current one, then pastes (p
) them below the current line.