Vim Cheatsheet

  • #vim
  • #unix

Movement

ModeCommandDescription
NORMALjdown
NORMALkup
NORMALlright
NORMALhleft
NORMAL]jump down to next empty line
NORMAL[jump up to next empty line
NORMALggtop
NORMALGbottom
NORMALwword start
NORMALeword end
NORMAL0line start
NORMAL$line end

Editing

ModeCommandDescription
VISUALycopy
NORMALyycopy line
NORMALyecopy until word end
NORMALyi[x]copy in x
NORMALya[x]copy around x
NORMALyt[x]copy until x
NORMALppaste
VISUALdcut
NORMALddcut line
NORMALdi[x]cut in x
NORMALda[x]cut around x
NORMALdt[x]cut until x
NORMALr[x]replace character with x
NORMALxcut character
COMMAND%s/[x]/[y]/greplace x with y

Workflow

ModeCommandDescription
NORMALq[x]...qrecord ... macro to x
NORMAL@[x]replay macro