Neovim#
Neovim (nvim) is the modal terminal editor that ships with
built-in LSP, Tree-sitter, terminal, floating
windows, and a Lua scripting runtime. Bindings are
Vim-compatible by default, so every motion / verb / textobject
that works in classic Vim works here; the additions are
Neovim-only features (terminal mode, :Telescope-style
pickers via plugins, the built-in LSP keymap, and Lua
vim.keymap.set for user bindings).
For startup files, plugin managers (lazy.nvim,
packer.nvim), and the difference from Vim, see
Neovim (if present) or the upstream docs.
Modes#
Key |
Action |
|---|---|
|
return to normal mode |
|
insert before cursor |
|
insert after cursor (append) |
|
insert at start of line (first non-blank) |
|
insert at end of line |
|
open new line below, enter insert |
|
open new line above, enter insert |
|
enter replace mode (overtype) |
|
enter character-wise visual |
|
enter line-wise visual |
|
enter block (column) visual |
|
reselect last visual region |
|
enter command-line mode |
|
enter search forward / backward |
|
return to normal mode from terminal mode |
Movement#
Key |
Action |
|---|---|
|
left / down / up / right |
|
next word start / prev word start / word end |
|
WORD variants (whitespace-delimited) |
|
previous word end |
|
start / first non-blank / end of line |
|
last non-blank on line |
|
find next / previous |
|
till next / previous |
|
repeat last |
|
go to file start |
|
go to file end |
|
go to line N |
|
go to line N (command form) |
|
top / middle / bottom of screen |
|
half-page down / up |
|
full-page down / up |
|
jump to matching |
|
search forward / backward for word under cursor |
|
jump backward / forward through jumplist |
|
previous / next change in changelist |
|
jump to mark (line / exact position) |
|
set mark in current buffer |
|
set global mark across buffers |
Editing#
Key |
Action |
|---|---|
|
delete char under / before cursor |
|
substitute char / whole line (enter insert) |
|
replace single char with |
|
delete over motion ( |
|
delete whole line |
|
delete to end of line |
|
change over motion ( |
|
change whole line |
|
change to end of line |
|
yank over motion |
|
yank whole line |
|
yank to end of line |
|
paste after / before cursor |
|
prefix to choose a register (e.g. |
|
undo |
|
redo |
|
undo every change on current line |
|
repeat last change |
|
join line below into current |
|
join without inserting whitespace |
|
toggle case of char under cursor |
|
toggle case over motion |
|
lowercase / uppercase over motion |
|
indent / dedent current line |
|
indent / dedent inside a code block |
|
reindent over motion / current line |
|
increment / decrement number under cursor |
Textobjects#
Combine with verbs: daw deletes a word with surrounding
whitespace, ci( changes inside parens, yi" yanks inside
a string.
Key (after verb) |
Action |
|---|---|
|
inside / around word |
|
inside / around WORD |
|
inside / around sentence |
|
inside / around paragraph |
|
inside / around parens (same as |
|
inside / around brackets |
|
inside / around braces |
|
inside / around angle brackets |
|
inside / around double-quoted string |
|
inside / around single-quoted string |
|
inside / around backtick string |
|
inside / around XML / HTML tag |
Visual Mode#
After entering v / V / Ctrl-v, motions extend the
selection; verbs act on it.
Key |
Action |
|---|---|
|
move to other end of selection (toggle anchor) |
|
grow selection to textobject |
|
delete selection |
|
change selection |
|
yank selection |
|
shift right / left |
|
lowercase / uppercase selection |
|
toggle case of selection |
|
substitute within selection |
|
insert text at start of every selected line |
|
append text at end of every selected line |
|
exit visual mode |
Search and Replace#
Key |
Action |
|---|---|
|
search forward |
|
search backward |
|
next / previous match |
|
search forward / backward for word under cursor |
|
same as |
|
clear search highlight |
|
substitute first match on current line |
|
substitute every match on current line |
|
substitute every match in the buffer |
|
same, but confirm each replacement |
|
delete every line matching |
|
delete every line not matching |
Windows / Splits / Tabs#
Key |
Action |
|---|---|
|
horizontal split |
|
vertical split |
|
focus split left / down / up / right |
|
move current window left / down / up / right |
|
cycle through splits |
|
close every split except current |
|
close current split |
|
equalize sizes |
|
maximize current split’s height |
|
maximize current split’s width |
|
taller / shorter |
|
wider / narrower |
|
new tab |
|
next / previous tab |
|
jump to tab N |
|
close current tab |
Buffers#
Command |
Action |
|---|---|
|
open file in current window |
|
new empty buffer |
|
list buffers |
|
switch to buffer by name or number |
|
next / previous buffer |
|
delete (close) current buffer |
|
force-close without saving |
|
swap to alternate buffer |
|
write current buffer |
|
write to a different file |
|
write all |
|
write and quit |
|
quit, discarding changes |
LSP (Built-in)#
Neovim’s built-in LSP client. :LspInfo shows attached
servers. Default bindings are sparse; most distributions
(LazyVim, AstroNvim, NvChad, kickstart.nvim) set up the
gd / K / gr family on LspAttach.
Key / Command |
Action |
|---|---|
|
hover (signature + docs) |
|
goto definition (when bound; default in nightly) |
|
goto declaration |
|
goto implementation |
|
goto type definition |
|
list references |
|
alternate goto-definition binding (tags / LSP) |
|
jump back from tag / definition |
|
previous / next diagnostic |
|
LSP code action (common mapping) |
|
LSP rename (common mapping) |
|
format buffer (common mapping) |
|
show attached servers / capabilities |
|
restart language server |
|
open LSP log |
Terminal Mode#
Neovim ships a built-in terminal emulator.
Key / Command |
Action |
|---|---|
|
open terminal in current window |
|
terminal in horizontal split |
|
exit terminal mode (go to normal mode) |
|
close terminal buffer |
|
re-enter terminal mode (from normal mode) |
|
command-line from terminal mode (rebind common) |
Folds#
Key |
Action |
|---|---|
|
create fold over motion |
|
open fold under cursor |
|
open fold and every nested fold under cursor |
|
close fold under cursor |
|
close fold and every nested fold |
|
toggle fold under cursor |
|
open all folds in buffer |
|
close all folds in buffer |
|
next / previous fold |
|
delete fold under cursor |
|
eliminate every manually-created fold |
Macros and Registers#
Key |
Action |
|---|---|
|
start recording macro into register |
|
stop recording |
|
replay macro stored in |
|
replay last-run macro |
|
replay macro N times |
|
yank to / paste from register |
|
yank / paste through system clipboard ( |
|
yank / paste through X11 PRIMARY ( |
|
paste last yank (skipping the delete register) |
|
print every register |
|
paste from register at cursor |
Command Line (:)#
Command |
Action |
|---|---|
|
write |
|
write all |
|
quit / force-quit |
|
write + quit |
|
quit all (fails on unsaved) |
|
force-quit all |
|
open file |
|
reload buffer, discard unsaved changes |
|
enable / disable option |
|
print current value |
|
buffer-local option |
|
read commands from a vim / lua file |
|
read commands from a Lua file |
|
open help |
|
run health checks (Neovim’s own diagnostic) |
|
show recent messages |
Discovery#
Command |
Action |
|---|---|
|
print Neovim version + build features |
|
launch without user config / plugins |
|
launch with no init file |
|
bundled 30-minute interactive tutorial |
|
master index of every key in normal mode |
|
mode reference |
|
environment / provider checks |
|
lazy.nvim plugin UI |
|
attached LSP servers |
|
common picker plugin |
|
default Lua-based init file |
|
legacy Vimscript init file |