vi

delete lines containing "pattern" :g/pattern/d

replace :1,$s/old/new/g

search pattern "?xx" /.xx

replace multiple spaces with one space:%s/\s\+/ /g

vimdiff

#MOVING BETWEEN WINDOWS

CTRL-W h # move to the window on the left

CTRL-W j # move to the window below

CTRL-W k # move to the window above

CTRL-W l # move to the window on the right

CTRL-W t # move to the TOP window

CTRL-W b # move to the BOTTOM window

#Moving windows

CTRL-W K # move window to the upper

CTRL-W H #move window to the far left

CTRL-W J # move window to the bottom

CTRL-W L # move window to the far right



# delete every second line

https://stackoverflow.com/questions/1946738/vim-how-to-delete-every-second-row

  • Start in command mode.
  • Go to the beginning of the file by pressing gg.
  • Press qq.
  • Click arrow down and press dd after.
  • Press q.
  • Press 10000@q