Skip to content

Instantly share code, notes, and snippets.

@timsonner
Last active March 9, 2026 05:28
Show Gist options
  • Select an option

  • Save timsonner/cee255309a2b7ee9877e95b86dc004db to your computer and use it in GitHub Desktop.

Select an option

Save timsonner/cee255309a2b7ee9877e95b86dc004db to your computer and use it in GitHub Desktop.
Vim Reference

Vim Reference

Category Command Action
Movement gg / G Top / Bottom of file
Movement 0 / $ Start / End of line
Movement ^ First non-space character of line
Movement f / F + <char> Find character forward / backward
Movement t / T + <char> Till character forward / backward
Movement ; Repeat last f or t jump
Movement gd Go to Definition (local)
Movement Ctrl + o Jump Back to previous location
Editing i / a Insert / Append mode
Editing ciw Change Word (Delete and enter Insert mode)
Editing dw Delete Word
Editing x Delete Character
Editing u / Ctrl + r Undo / Redo
Editing . Repeat last editing action
Editing >> / << Indent / Outdent line
Editing =% Auto-Indent current code block
Search /pattern Search for text
Search n / N Next / Previous search match
Search * Search Word under cursor
Search :noh Clear Highlights from search
Search :%s/old/new/g Global Replace in file
Visual v / V Visual / Visual Line selection mode
Visual Ctrl + v Visual Block (Useful for multi-line # comments)
Windows Ctrl + w, w Cycle through open windows
Windows Ctrl + w, r Rotate window positions
Windows Ctrl + w, <HJKL> Move Window Left, Bottom, Top, Right
Windows Ctrl + w, o Only (Close all windows except current)
Windows :hid Hide current window (keeps buffer alive)
Windows :sp / :vsp Horizontal / Vertical split
Windows :res <N> Resize selected window
Buffers :ls List Buffers (Show all open files/terminals)
Buffers :b <N> Switch to buffer by number N
Buffers :sb <N> Split Buffer (Open buffer N in horizontal split)
Buffers :vsp <N> Vertical Split Buffer (Open buffer N vertically)
Buffers :bd Delete Buffer (Close file/terminal)
Execution :!python3 % Run Script (External shell)
Execution :term Terminal (Open internal terminal window)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment