HomeCheat SheetsVim & Neovim Commands Cheat Sheet
100% Client-Side β€’ 0 B Data Leaves Browser
terminal

Vim & Neovim Commands Cheat Sheet

Comprehensive keyboard shortcut and command reference for Vim and Neovim. Modes, navigation, editing, search/replace, and buffers.

Exiting & Saving

Write (save) current file without quitting:w
Quit Vim (fails if unsaved changes exist):q
Write changes and quit Vim:wq or :x or ZZ
Quit immediately and discard all unsaved changes:q!

Navigation & Cursor Movement

Move left, down, up, righth / j / k / l
Jump forward / backward to start of next wordw / b
Jump to end of next / previous worde / ge
Jump to absolute beginning / end of line0 / $
Jump to first non-blank character of line^
Jump to very first / very last line of filegg / G
Jump directly to line number:<number> or <number>G

Editing & Manipulating Text

Insert mode before cursor / append mode after cursori / a
Open new line below / above and enter insert modeo / O
Delete character under cursorx
Delete (cut) current line / multiple linesdd / <number>dd
Yank (copy) current line / multiple linesyy / <number>yy
Paste after / before cursorp / P
Undo last change / redo changeu / Ctrl+r
Change word (deletes word and enters insert mode)cw

Search & Replace

Search forward for pattern/pattern
Search backward for pattern?pattern
Repeat search in same / opposite directionn / N
Substitute all occurrences of old with new across entire file:%s/old/new/g
Substitute with interactive confirmation prompt for each occurrence:%s/old/new/gc

Frequently Asked Questions

β€’ How do I safely exit Vim without saving broken edits?

Press `Esc` multiple times to ensure you are in Normal mode, then type `:q!` and press `Enter` to force quit without saving.