Vim Quick tips

  • To change only 3 words use “c3w”
  • To save file despite without writing permission “:w !sudo tee %”
  • To jump forward looking the 3rd N “3fN”
  • Write on new line “o”
  • To copy line “yy”
  • To replace (substitute) character A to B in the file globally (g) “:%s/A/B/g”
  • Search forward “n”, Search backward “N”
  • To list the sentence line “:set number”
  • List down all buffer “:ls”
    • Jump to buffer 3 “:b3”
    • delete buffer “:bd”
    • previous buffer “:bp” and next buffer “:bn”
  • Split windows vertical “ctrl + w and v”
    • Cycle around windows “ctrl + w and w”
    • Close all windows except the open one ” ctrl + w and o”
    • Swap windows buffer “ctrl + w and x”