Online Vim Editor

Browser Vim editor (hjkl, insert, normal). Content autosaves locally.

Vim cheatsheet

Modes

  • EscNormal mode
  • iaInsert before / after cursor
  • IAInsert at start / end of line
  • oOOpen line below / above
  • vVVisual / visual line

Motion

  • hjklLeft / down / up / right
  • wbeWord forward / back / end
  • 0^$Line start / first char / end
  • ggGFile start / end
  • ftFind / till character

Edit

  • xDelete character
  • ddccyyDelete / change / yank line
  • dcyOperator + motion
  • pPPaste after / before
  • uCtrl-rUndo / redo
  • .Repeat last change

Search

  • /?Search forward / back
  • nNNext / previous match

Examples

Search

  • /fooEnterSearch forward for foo
  • ?fooSearch backward for foo
  • nNNext / previous match
  • *#Word under cursor forward / back

Search and replace

  • :s/old/new/First match on the current line
  • :s/old/new/gAll matches on the current line
  • :%s/old/new/gAll matches in the file
  • :%s/old/new/gcAll matches in the file, confirm each

Copy and paste

  • yyYank (copy) the current line
  • ddCut the current line
  • ywYank from cursor to end of word
  • pPPaste after / before

Select all

  • ggVGSelect the whole file (visual line)
  • ggVGyCopy the whole file
  • ggVGdDelete the whole file