nvim cheat sheet

<leader> = <Space> (spacebar)  ·  config = ~/.config/nvim (Linux/Mac)  /  %LOCALAPPDATA%\nvim (Windows)  ·  :checkhealth to verify setup

Key Notation

Keys shown as like this are pressed literally. The table below explains the shorthand notation used in key sequences.

C-x Ctrl + x Hold Control, press x
S-x Shift + x Hold Shift, press x — e.g. S-h means Shift+H
A-x Alt + x Hold Alt (Option on Mac), press x
M-x Meta + x Same as Alt on most systems
<leader> Space The leader key — tap Space first, then the rest of the sequence
<CR> Enter / Return The carriage return key
<Esc> Escape Or use jk from insert mode (mapped in this config)
<Tab> Tab
<BS> Backspace
{motion} any motion e.g. w (word), j (line down), $ (end of line), ip (inner paragraph)
[op] operator-pending Key only active while waiting for a motion after an operator like d, y, c
[vis] visual mode Key active when text is selected
Modes
entering insert mode
i / a Insert before / after cursor
I / A Insert at line start / end
o / O New line below / above, then insert
s Delete char and insert remapped to Flash in this config
other modes
v / V Visual character / line mode
C-v Visual block mode (column select)
R Replace mode (overtype)
: Command-line mode
returning to normal mode
Esc / jk Normal mode from insert (jk = this config)
C-\C-n Normal mode from terminal (Esc Esc = this config)
Basic Motion
character & word
h j k l Left / down / up / right
w / b Next / prev word start
e Next word end
W / B / E Same, skipping punctuation
line
0 / $ Line start / end
^ First non-blank character
file & screen
gg / G File start / end
{ / } Prev / next blank line
% Jump to matching bracket
H / M / L Screen top / middle / bottom
5j Any count prefix works — e.g. 5 lines down
jump list
C-o / C-i Jump back / forward in location history
gi Return to last insert location
'' Jump back to last cursor position
Operators
Operators combine with a motion or text object: dw, ciw, y$
d{motion} Delete
c{motion} Change (delete + enter insert)
y{motion} Yank (copy)
dd / yy / cc Delete / yank / change whole line
D / C Delete / change to end of line
x Delete character under cursor
r{char} Replace character not to be confused with remote-flash r
p / P Paste after / before cursor
u / C-r Undo / redo
. Repeat last change
~ Toggle case of character
>> / << Indent / un-indent line
Text Objects
Use after any operator or in visual mode: diw, vap, ci"
i / a inner (excludes delimiters) / around (includes them)
built-in
iw / aw Word / word + surrounding space
ip / ap Paragraph
i" / a" Double-quoted string
i' / a' Single-quoted string
i` / a` Backtick string
i( / a( Parentheses
i[ / a[ Square brackets
i{ / a{ Curly braces
it / at HTML / XML tag
treesitter (this config)
if / af Function inner / outer
ic / ac Class inner / outer
ia / aa Argument / parameter
ii / ai Conditional inner / outer
il / al Loop inner / outer
Search
/{pattern} Search forward
?{pattern} Search backward
n / N Next / prev match (centred in this config)
* / # Search word under cursor forward / backward
Esc Clear highlights
substitution (command mode)
:%s/old/new/g Replace all in file
:s/old/new/g Replace all on current line
add c flag Confirm each replacement interactively
General
<leader>w Save file
<leader>q Quit
<leader>Q Force quit all
<leader>a Select all
<leader>? Show buffer keymaps (which-key)
<Esc> Clear search highlights
jk Exit insert mode
Windows & Splits
C-h/j/k/l Navigate windows (+ tmux panes)
C-Up / C-Down Resize height
C-Left / C-Right Resize width
<leader>sv Split vertical
<leader>s- Split horizontal
<leader>se Equalize splits
<leader>sx Close split
Buffers & Tabs
S-h / S-l Previous / next buffer
<leader>bd Delete buffer
<leader>bD Force delete buffer
<leader>be Buffer explorer (float)
<leader>bp Toggle pin buffer
<leader>bP Close all unpinned buffers
<leader>bo Close other buffers
<leader>br Close buffers to the right
<leader>bl Close buffers to the left
<leader><tab>n New tab
<leader><tab>x Close tab
<leader><tab>] / [ Next / prev tab
Motion & Navigation
s Flash jump to any word on screen
S Flash treesitter node select
r op Remote flash (e.g. yr<jump>)
R op/vis Treesitter search across screen
f F t T Enhanced with flash jump labels
C-d / C-u Scroll half-page (cursor centred)
n / N Search result (cursor centred)
J Join lines (cursor stays put)
]t / [t Next / prev TODO comment
[x Jump up to treesitter context
File Explorer (Neo-tree)
<leader>e Toggle explorer sidebar
<leader>E Reveal current file in explorer
<leader>ge Git status explorer (float)
inside neo-tree
l / h Open / close node
a New file or folder
d Delete
r Rename
H Toggle hidden files
Y Copy full path to clipboard
P Preview (focus stays in tree)
Telescope — Find
<leader>fs Find symbol (LSP workspace, fuzzy)
<leader>ff Find files
<leader>fF Find files (include hidden)
<leader>fg Live grep
<leader>fw Grep word under cursor
<leader>fr Recent files
<leader>fb Buffers
<leader>/ Fuzzy find in current buffer
<leader>: Command history
inside picker
C-j / C-k Move down / up
C-n / C-p History next / prev
C-q Send selection to quickfix
Esc Close
Telescope — Search
<leader>ss Document symbols
<leader>sS Workspace symbols
<leader>sh Help pages
<leader>sk Keymaps
<leader>sm Marks
<leader>sd Document diagnostics
<leader>sD Workspace diagnostics
<leader>sc Commands
<leader>st TODO comments
<leader>sr Replace in files (Spectre)
<leader>sR vis Replace selection (Spectre)
LSP
gd Go to definition
gD Go to declaration
gr Go to references
gI Go to implementation
gy Go to type definition
K Hover documentation
<leader>cr Rename symbol
<leader>ca Code action
<leader>cf Format buffer (or selection)
<leader>cs Document symbols
<leader>cS Workspace symbols
<leader>ch Toggle inlay hints
<leader>ci LSP info
<leader>cm Mason package manager
[d / ]d Prev / next diagnostic
<leader>cd Line diagnostics float
Completion (blink.cmp)
insert mode — menu navigation
C-Space Open menu / toggle docs
C-n / C-p Next / prev item (opens menu if hidden)
Tab / S-Tab Next / prev item
CR Accept selected item
C-e Close menu
C-b / C-f Scroll documentation up / down
snippets (LuaSnip)
Tab Expand snippet / jump to next placeholder
S-Tab Jump to previous placeholder
Diagnostics & Quickfix (Trouble)
<leader>xx All diagnostics
<leader>xX Buffer diagnostics
<leader>xs Symbols panel
<leader>xt TODOs panel
<leader>xL Location list
<leader>xQ Quickfix list
[e / ]e Prev / next trouble item
<leader>xq Open quickfix
<leader>xl Open location list
[q / ]q Prev / next quickfix item
Git — Gitsigns
]h / [h Next / prev hunk
]H / [H Last / first hunk
<leader>ghs Stage hunk
<leader>ghr Reset hunk
<leader>ghS Stage buffer
<leader>ghR Reset buffer
<leader>ghu Undo stage hunk
<leader>ghp Preview hunk
<leader>ghb Blame line (full)
<leader>ghB Blame buffer
<leader>ghd Diff this
<leader>ghD Diff this against parent (~)
ih textobj Select hunk
<leader>gp Toggle PR diff mode (gutter vs merge-base)
<leader>gpb PR diff mode — prompt for custom base ref
Git — Neogit / Diffview / Telescope
<leader>gg Neogit (magit-style)
<leader>gG Neogit (file's directory)
<leader>gd DiffView open
<leader>gD DiffView close
<leader>gh File history
<leader>gH Repo history
<leader>gf Fugitive
<leader>gB Browse file on remote
<leader>gc Git commits (Telescope)
<leader>gC Buffer commits (Telescope)
<leader>gb Git branches (Telescope)
<leader>gs Git status (Telescope)
<leader>gS Git stash (Telescope)
<leader>gP PR file changes (DiffView vs merge-base)
<leader>gPb PR file changes — prompt for custom base ref
Editing
A-j / A-k Move line / selection up or down
< / > vis Indent (stays in visual mode)
p vis Paste without overwriting register
<leader>d Delete to black hole (no register)
gc motion Toggle comment
gcc Toggle line comment
system clipboard
"+y{motion} Yank to system clipboard
"+p Paste from system clipboard
surround (nvim-surround)
ys{motion}{char} Add surround
yss{char} Surround current line
ds{char} Delete surround
cs{old}{new} Change surround
Rust (rustaceanvim)
K Hover actions
<leader>cA Code action (Rust)
<leader>re Expand macro
<leader>rR Runnables
<leader>rt Testables
<leader>rd Debuggables
<leader>rp Parent module
<leader>rj Join lines
<leader>ro Open on docs.rs
<leader>rg Crate graph
<leader>rr Related diagnostics
Cargo.toml (crates.nvim)
<leader>ct Toggle crates info
<leader>cr Reload crates
<leader>cv Show crate versions
<leader>cf Show crate features
<leader>cd Show dependencies
<leader>cu Update crate
<leader>cU Update all crates
<leader>cg Upgrade crate
<leader>cG Upgrade all crates
Laravel (laravel.nvim)
<leader>la Artisan command picker
<leader>lr Routes browser
<leader>lm Related files (model ↔ migration, controller ↔ view)
Database (vim-dadbod)
<leader>Du Toggle DB UI
<leader>Da Add connection
<leader>Df Find DB buffer
inside sql buffer
<leader>DS Execute query
<leader>DE Edit bind parameters
Terminal
<leader>tt Open terminal
Esc Esc Exit terminal mode
C-h/j/k/l Navigate out to Nvim window
UI Toggles
<leader>uc Toggle cloak (.env value masking)
<leader>ut Toggle treesitter context header
<leader>um Toggle Markdown rendering
C-s cmdline Toggle flash in / search
<leader>un Dismiss all notifications
noice (messages / cmdline)
S-Enter cmdline Redirect cmdline output to split
<leader>snl Last message
<leader>snh Message history
<leader>sna All messages
<leader>snd Dismiss all
Quick Install
git clone https://github.com/Cazzar/nvim %LOCALAPPDATA%\nvim

Open Neovim — plugins install automatically. Then:

:Lazy sync
:Mason
git clone https://github.com/Cazzar/nvim ~/.config/nvim

Open Neovim — plugins install automatically. Then:

:Lazy sync
:Mason
git clone https://github.com/Cazzar/nvim ~/.config/nvim

Open Neovim — plugins install automatically. Then:

:Lazy sync
:Mason