Vim-cheatsheet

From wikipost
Jump to navigation Jump to search

Cursor movement

gg      home
G       end


Markers

ma      set current position for mark A
'a      jump to position of mark A
['      previous mark
]'      next mark

:marks  show list of marks


Find and Replace

:%s/word1/word2/g     entire document, all instances on a line
:%s/word1/word2/gc    entire document, all instances on a line, with confirmation
:,$s/word1/word2/c    staring from current line, first instance, with confirmation