Vi

From Linuxintro

replace

:1,%s/old text/new text/g

1 -> first line

$ -> last line

s -> replace

you cannot use wildcards (*,?) for the text to be replaced, but you can use e.g. [0-9]

concatenate lines

Press J, it concatenates the actual and the next line.

repeat last action

In the order mode, press ..

block-based actions

u undoes the last action

  1. CTRL_v and mark lines in the block mode
  2. CTRL_i insert the wished items
  3. ESC