Vim / Neovim Cheat Sheet & Commands
Navigation Motions
- h / j / k / l : Left, Down, Up, Right
- w / b / e : Word forward, backward, end
- 0 / ^ / $ : Start of line, first char, end of line
- gg / G : Top of file / Bottom of file
- {num}G : Jump to line number
- f{char} / F{char} : Find char forward / backward
- % : Jump to matching bracket () {} []
Editing & Text Manipulation
- i / a / I / A : Insert before/after char, start/end line
- o / O : Open new line below / above
- x / dw / dd : Delete char, word, entire line
- yy / p / P : Yank line, Paste after / before
- u / Ctrl+R : Undo / Redo
- . : Repeat last change
- r{char} / R : Replace char / Replace mode
Visual & Selection Modes
- v : Visual Character Mode
- V : Visual Line Mode
- Ctrl + v : Visual Block Mode
- d / y / c : Delete, Yank, or Change selection
- > / < : Indent / Unindent selection
Ex Commands (:)
- :w : Save file (downloads or updates buffer)
- :q / :wq : Close buffer / Save and close
- :s/old/new/g : Substitute in current line
- :%s/old/new/g : Substitute in entire file
- :set nu / rnu : Enable absolute / relative numbers
- :bnext / :bprev : Switch buffer