If your pipe delimited lines start at line #1, move the cursor to line #1, and press Shift-o (letter 'o') to add a blank line above your first line.
Make sure the cursor is in the new first line. Press q a to start to record your key stroke series into register 'a'. ( q - start to record; a - record to register 'a')
Press j d 3 f | q ( j - down; d - delete; 3 - the 3rd pipe; f - find; | - pipe sign; q - finish recording)
Press u to undo the deletion.
Check how many lines are there all together, say, 1000.
Move the cursor back to the first line, then press 1000 @ a ( 1000 - run the recorded key stroke series 1000 times; @ - run the recorded key stroke series; a - in register 'a') You have achieved what you want.
1条答案
按热度按时间qeeaahzv1#
Shift-o
(letter 'o') to add a blank line above your first line.q a
to start to record your key stroke series into register 'a'. (
q
- start to record;a
- record to register 'a')j d 3 f | q
(
j
- down;d
- delete;3
- the 3rd pipe;f
- find;|
- pipe sign;q
- finish recording)u
to undo the deletion.
1000 @ a
(
1000
- run the recorded key stroke series 1000 times;@
- run the recorded key stroke series;a
- in register 'a')You have achieved what you want.