Vim

Vim quick start guide

vim basics

Quick start

In normal mode (Esc)

  • Insert mode i
  • Move cursor h j k l
  • Undo u
  • Redo Shift+R
  • Find /
    • Find next n
    • Find previous N
  • Save :w
  • Quit :q
  • Quit without saving :q!
  • Delete all gg dG

Additional

In normal mode (Esc)

  • Delete right x
  • Delete left X
  • Delete line dd
  • Move to the beginning of the next word b
  • Move to the beginning of this or the previous word w
  • Move to the end of this or the next word e
  • Move to the start of the line 0
  • Move to the end of the line $
  • Move to the start of the document gg
  • Move to the end of the document G
  • Visual mode v
  • Open new line below and go to insert mode o
  • Open new line above and go to insert mode O
  • Go to corresponding parenthesis %

Diff

vim -d <file1> <file2>

In normal mode (Esc)

  • Accept the diff at the cursor :diffget or :diffg
  • Move to left window Ctrl+W h
  • Move to right window Ctrl+W l
  • Next diff ]c
  • Previous diff [c
Code licensed under the MIT License; all other content under CC BY-SA 4.0.
Last updated on Jan 23, 2026 11:31 UTC
Built with Hugo
Theme Stack designed by Jimmy