A quick reference for Neovim commands and keybindings. Covers navigation, editing, search, windows, and more.
Modes
| Key | Description |
|---|---|
| i | Enter Insert mode before cursor |
| a | Enter Insert mode after cursor |
| o | Open new line below and enter Insert mode |
| O | Open new line above and enter Insert mode |
| v | Enter Visual mode (character selection) |
| V | Enter Visual Line mode |
| Ctrl+v | Enter Visual Block mode |
| R | Enter Replace mode |
| Esc | Return to Normal mode |
Navigation
| Key | Description |
|---|---|
| h / j / k / l | Move left / down / up / right |
| w / b | Jump forward / backward by word |
| e | Jump to end of word |
| 0 / $ | Jump to start / end of line |
| ^ | Jump to first non-blank character |
| gg / G | Jump to first / last line |
| {number}G | Jump to line number |
| { / } | Jump to previous / next paragraph |
| Ctrl+d / Ctrl+u | Scroll half page down / up |
| Ctrl+f / Ctrl+b | Scroll full page down / up |
| % | Jump to matching bracket |
| H / M / L | Jump to top / middle / bottom of screen |
Editing
| Key | Description |
|---|---|
| x | Delete character under cursor |
| dd | Delete (cut) current line |
| D | Delete from cursor to end of line |
| cc | Change (delete and enter Insert mode) current line |
| C | Change from cursor to end of line |
| yy | Yank (copy) current line |
| p / P | Paste after / before cursor |
| u | Undo |
| Ctrl+r | Redo |
| . | Repeat last change |
| J | Join current line with next |
| ~ | Toggle case of character under cursor |
| >> / << | Indent / unindent current line |
Text Objects & Operators
| Command | Description |
|---|---|
| diw | Delete inner word |
| ciw | Change inner word |
| yi" | Yank text inside double quotes |
| da( | Delete around parentheses (including parens) |
| ci{ | Change inside curly braces |
| dit | Delete inside HTML/XML tag |
| vip | Visually select inner paragraph |
| gUiw | Uppercase inner word |
| guiw | Lowercase inner word |
Search & Replace
| Command | Description |
|---|---|
| /pattern | Search forward for pattern |
| ?pattern | Search backward for pattern |
| n / N | Jump to next / previous match |
| * | Search forward for word under cursor |
| # | Search backward for word under cursor |
| :s/old/new/ | Replace first match on current line |
| :s/old/new/g | Replace all matches on current line |
| :%s/old/new/g | Replace all matches in file |
| :%s/old/new/gc | Replace all with confirmation |
| :noh | Clear search highlighting |
Windows & Splits
| Command | Description |
|---|---|
| :sp [file] | Horizontal split |
| :vsp [file] | Vertical split |
| Ctrl+w h/j/k/l | Navigate between splits |
| Ctrl+w w | Cycle through splits |
| Ctrl+w = | Equalize split sizes |
| Ctrl+w +/- | Increase / decrease split height |
| Ctrl+w >/< | Increase / decrease split width |
| Ctrl+w q | Close current split |
| Ctrl+w o | Close all other splits |
Tabs & Buffers
| Command | Description |
|---|---|
| :e <file> | Open file in current buffer |
| :bn / :bp | Next / previous buffer |
| :bd | Delete (close) current buffer |
| :ls | List all open buffers |
| :b <name> | Switch to buffer by partial name |
| :tabnew [file] | Open file in new tab |
| gt / gT | Next / previous tab |
| :tabclose | Close current tab |
Marks & Jumps
| Command | Description |
|---|---|
| ma | Set mark a at cursor position |
| 'a | Jump to line of mark a |
| `a | Jump to exact position of mark a |
| :marks | List all marks |
| Ctrl+o | Jump to previous position in jump list |
| Ctrl+i | Jump to next position in jump list |
Macros
| Command | Description |
|---|---|
| qa | Start recording macro into register a |
| q | Stop recording macro |
| @a | Play macro from register a |
| @@ | Replay last played macro |
| 10@a | Play macro a 10 times |
Command-Line Mode
| Command | Description |
|---|---|
| :w | Save current file |
| :q | Quit (fails if unsaved changes) |
| :wq / :x | Save and quit |
| :q! | Quit without saving |
| :wa | Save all open buffers |
| :!<cmd> | Run shell command |
| :r !<cmd> | Insert output of shell command |
| :set number | Show line numbers |
| :set relativenumber | Show relative line numbers |
| :terminal | Open built-in terminal |