Switch modes
basicsEsc — Normal mode; i — insert before the cursor; a — append after it; o — open a new line below and insert.
Insert: I at the start of the line, A at the end, O to open a line above.
Modes, movement, and editing without taking your hands off the keyboard. Search by action or shortcut, and copy commands when useful.
Most keys do different things depending on the current mode.
Esc — Normal mode; i — insert before the cursor; a — append after it; o — open a new line below and insert.
Insert: I at the start of the line, A at the end, O to open a line above.
:w save
:q quit
:wq or :x save and quit
:q! quit without savingTip: press Esc first, then type a command beginning with a colon.
Combine motion with operators: for example, d} deletes through the end of the paragraph.
h / j / k / l — left / down / up / right. 0 — start of line, ^ — first non-blank character, $ — end of line.
gg — start of file; G — end of file; 42G — line 42. H / M / L — top / middle / bottom of screen.
w — next word start; b — previous word start; e — word end. Uppercase W, B, E treat whitespace-delimited text as a word.
{ / } — previous / next paragraph; % — matching bracket; Ctrl+d / Ctrl+u — scroll half a screen.
f{char} — land on the character; t{char} — stop before it. Uppercase F and T search backward. ; repeats; , repeats in the opposite direction.
Vim grammar: operator + text object or motion. A count repeats the operation.
dd — delete line; dw — to next word; diw — inner word; d$ — to line end; x — character under cursor.
cc — change line; ciw — change word; C — change to line end. 2dd deletes two lines.
yy — yank line; yw — yank word; y$ — to line end. p pastes after / below; P before / above.
u — undo; Ctrl+r — redo; . — repeat the last change. A single insert session is one change if you leave Insert mode in one go.
v — characterwise; V — linewise; Ctrl+v — blockwise. Then use d to delete, y to yank, or > / < to indent.
Search the file, jump between matches, or replace text in a chosen range.
/text — forward; ?text — backward; n — next match; N — previous. * searches the word under the cursor forward; # searches backward.
:set hlsearch enables highlighting; :nohlsearch clears the current highlight.
:%s/old/new/g whole file
:%s/old/new/gc confirm each match
:'<,'>s/old/new/g Visual selection (type : while selected)Use a different delimiter, such as #, when the search text contains slashes.
A buffer is an open file; a window is a view onto a buffer.
:split / :sp — horizontal; :vsplit / :vs — vertical. Move with Ctrl+w, then h/j/k/l. Ctrl+w q closes a window.
:ls — list buffers; :b name — switch; :bnext / :bprev — next / previous; :bd — delete a buffer.
:tabnew file — new tab; gt / gT — next / previous; :tabclose — close tab.
Commands and built-in features specific to Neovim.
:terminal opens a terminal in the current window; :split | terminal or :vsplit | terminal opens one in a split. To return to Normal mode from Terminal mode, press Ctrl+\, then Ctrl+n.
Main config paths: ~/.config/nvim/init.lua or ~/.config/nvim/init.vim. Reload the current Lua config with :luafile %.
With an LSP configured, :lua vim.diagnostic.open_float() shows diagnostics at the cursor; :lua vim.diagnostic.goto_next() / goto_prev() move between them.
Clipboard integration may need clipboard support in the build or an external provider (for example, wl-clipboard on Wayland). In Lua config: vim.opt.clipboard = "unnamedplus".
:map.No matches. Try a different term or shortcut.