Neovim Cheatsheet

kickstart.nvim · Catppuccin Mocha · openSUSE Tumbleweed

Modes

Esc
→ Normal mode (always)
i
→ Insert before cursor
a
→ Insert after cursor
I
→ Insert at line start
A
→ Insert at line end
o / O
New line below / above
v
→ Visual (char)
V
→ Visual line
Ctrl+v
→ Visual block
:
→ Command mode

Navigation

Word / Line
w / b
Next / prev word start
e
Word end
0 / $
Line start / end
^
First non-blank char
File
gg / G
File top / bottom
{n}G
Go to line n
Ctrl+d / u
Half-page down / up
Screen
zz
Centre cursor on screen
H / M / L
Top / mid / bottom of screen
%
Jump to matching bracket
Ctrl+o / i
Jump back / forward in history
Horizontal Scroll (wrap off)
zs / ze
Scroll to cursor left / right edge
zh / zl
Scroll left / right one char
zH / zL
Scroll left / right half screen
Flash (fast jump)
s
Flash jump (type chars, pick label)
S
Treesitter node jump
r
Remote flash (operator-pending)
R
Treesitter search (op / visual)
Ctrl+s
Toggle flash labels on / search

Editing

Change / Delete
x
Delete char under cursor
dd
Delete line
dw / de
Delete word / to end
D
Delete to end of line
cc / C
Change line / to end
ciw
Change inner word (cursor anywhere)
ci" ci(
Change inside quotes / parens
Copy / Paste
yy
Yank (copy) line
yiw
Yank inner word
p / P
Paste after / before
Other
u / Ctrl+r
Undo / Redo
.
Repeat last change
r{c}
Replace char with c
~
Toggle case
J
Join line below
yyp
Duplicate line
>> / <<
Indent / dedent line

Search & Replace

/pattern
Search forward
?pattern
Search backward
n / N
Next / prev match
* / #
Search word under cursor fwd/bwd
Esc
Clear search highlights
Substitute
:s/old/new
Replace first on line
:s/old/new/g
Replace all on line
:%s/old/new/g
Replace all in file
:%s/old/new/gc
Replace with confirmation
Multi-change
/wordcgn
Change next match, then . to repeat
grug-far (project-wide replace)
Space+Sr
Open search & replace
VSpace+Sr
Open with selection pre-filled
Space+Sw
Open with word under cursor
Space+Sf
Scoped to current file
Telescope (Fuzzy)
Space+sg
Live grep across project
Space+sw
Search word under cursor
Space+/
Fuzzy search in current buffer

Files & Buffers

Telescope
Space+sf
Find files
Space+s.
Recent files
Space+Space
Open buffer list
Space+sn
Find Neovim config files
Commands
:w
Save file
:q / :q!
Quit / force quit
:wq
Save and quit
:e {file}
Open / edit a file
:bn / :bp
Next / prev buffer
:bd
Close buffer
Neo-tree
\
Toggle file explorer
Clipboard
Space+yp
Yank relative file path to clipboard
Session (auto-session)
Space+ws
Save session
Space+wr
Restore / search sessions
Space+wd
Delete a session

Splits & Windows

Open
:sp
Horizontal split
:vsp
Vertical split
Navigate
Ctrl+h/j/k/l
Move focus left/down/up/right
Resize
Ctrl+w =
Equalise split sizes
Ctrl+w >/<
Widen / narrow split
Manage
Ctrl+w o
Close all other windows
Ctrl+w q
Close this window

LSP — Code Intelligence

Navigate
grd
Go to definition
grr
Go to references
gri
Go to implementation
grt
Go to type definition
grD
Go to declaration
Ctrl+t
Jump back (after goto)
Symbols
gO
Document symbols
gW
Workspace symbols
Actions
K
Hover docs / signature
grn
Rename symbol (project-wide)
gra
Code action
Space+f
Format buffer
Diagnostics
[d / ]d
Prev / next diagnostic
Space+sd
Search diagnostics list
Space+q
Diagnostic quickfix list
Space+th
Toggle inlay hints

Telescope

Space+sf
Find files
Space+sg
Live grep (ripgrep)
Space+sh
Search help tags
Space+sk
Search keymaps
Space+sc
Search commands
Space+ss
Select Telescope picker
Space+sr
Resume last search
Inside Telescope
Ctrl+/
Show all keymaps (insert mode)
?
Show all keymaps (normal mode)
Ctrl+c
Close picker
Integrations
Ctrl+t
Send results → Trouble
Ctrl+s / s
Flash jump to result (insert / normal)

Git / Gitsigns

Hunk Navigation
]h / [h
Next / prev hunk
Hunk Actions
Space+hs
Stage hunk
Space+hr
Reset hunk
Space+hS
Stage buffer
Space+hu
Undo stage hunk
Space+hp
Preview hunk diff
Space+hb
Blame line
Space+hd
Diff this file
Space+tb
Toggle current line blame
LazyGit
Space+gg
Open LazyGit
Diffview
Space+gd
Open diffview (vs index)
Space+gh
File history (current file)
Space+gH
File history (branch)
Space+gx
Close diffview
Inside Diffview
[x / ]x
Prev / next conflict
Space+co / ct
Choose ours / theirs
- / S
Stage / stage all
Tab / Shift+Tab
Next / prev changed file

Text Objects (d/c/y + i/a + obj)

iw / aw
Inner / around word
is / as
Inner / around sentence
ip / ap
Inner / around paragraph
i" i' i`
Inside quotes
i( i[ i{
Inside brackets / braces
it
Inside HTML tag
Examples
diw
Delete inner word
ci(
Change inside parens
ya"
Yank including quotes
vap
Visually select paragraph

Folds

za
Toggle fold under cursor
zc / zo
Close / open fold
zM
Close all folds
zR
Open all folds
zj / zk
Next / prev fold
Setup (in init.lua)
foldmethod=expr
Treesitter-based folds

Macros & Registers

Macros
q{a}
Record macro into register a
q
Stop recording
@{a}
Play macro from register a
@@
Replay last macro
{n}@@
Replay macro n times
Registers
:reg
Show all registers
"{a}y
Yank into register a
"{a}p
Paste from register a
"+y / "+p
System clipboard yank / paste

Completion (blink.cmp)

Ctrl+Space
Open menu / show docs
Ctrl+n / p
Next / prev item
Ctrl+y
Accept selection (yes)
Ctrl+e
Dismiss menu
Ctrl+k
Toggle signature help
Snippets
Tab / Shift+Tab
Jump next / prev placeholder

Terminal (toggleterm)

Open
Ctrl+\
Toggle terminal (float by default)
Space+tf
Open float terminal
Space+th
Open horizontal split terminal
Space+tv
Open vertical split terminal
Inside Terminal
EscEsc
Exit terminal mode → Normal
Ctrl+\
Close / hide terminal
Ctrl+h/j/k/l
Navigate to other windows (splits only)

Neo-tree

Toggle
\
Reveal / close explorer
Navigate
j / k
Down / up
Enter
Open file / expand dir
Space
Expand / collapse node
BS
Go up to parent dir
.
Set dir as root
H
Toggle hidden files
/
Fuzzy find in tree
P
Preview file (float)
[g / ]g
Prev / next git change
< / >
Switch source (files / git / buffers)
Open in…
S / s
Horizontal / vertical split
t
Open in new tab
File ops
a / A
New file / new directory
r
Rename
d
Delete
y / x / p
Copy / cut / paste
?
Show all keymaps

Testing (Neotest)

Run
Space+nn
Run nearest test
Space+nf
Run current file
Space+na
Run all tests (cwd)
Space+nl
Re-run last test
Output
Space+ns
Toggle summary panel
Space+no
Open output window
Space+nO
Toggle output panel
Space+nw
Watch current file
Navigate
Space+nj
Jump to next failure
Space+nk
Jump to prev failure

Trouble (Diagnostics)

Diagnostics
Space+xx
Project diagnostics
Space+xX
Buffer diagnostics
Code
Space+xs
Document symbols
Space+xl
LSP refs / definitions
Lists
Space+xL
Location list
Space+xQ
Quickfix list
Inside Trouble
Enter / o
Jump to item
} / {
Next / prev item
q
Close Trouble

Harpoon (Pinned Files)

Mark
Space+ha
Pin current file
Space+hh
Toggle harpoon menu
Jump
Space+1
Go to pinned file 1
Space+2
Go to pinned file 2
Space+3
Go to pinned file 3
Space+4
Go to pinned file 4
In Menu
Enter
Open file
edit lines to reorder / delete
Pins are per git branch

Claude Code (AI)

Session
Space+ac
Toggle Claude pane
Space+af
Focus Claude pane
Space+ar
Resume last session
Space+aC
Continue session
Context
Space+ab
Add current buffer
VSpace+as
Send selection to Claude
Space+as (neo-tree)
Add file to context
Diffs
Space+aa
Accept diff
Space+ad
Deny diff

Useful Commands & Tricks

Plugin Management
:Lazy
Open plugin manager UI
:Mason
Manage LSP servers / tools
:checkhealth
Diagnose Neovim issues
Handy Editing
g~iw
Toggle case of word
gUiw / guiw
Uppercase / lowercase word
Ctrl+a / x
Increment / decrement number
ga
Show char code under cursor
:sort
Sort selected lines
Space+tm
Toggle markdown rendering
Space+tw
Toggle soft wrap
Marks
m{a}
Set mark a at cursor
`{a}
Jump to mark a
:marks
List all marks
Command Line Tricks
:!
Run shell command
:.!
Replace line with cmd output
Ctrl+r %
Paste current filename (cmd mode)
@:
Repeat last command
Space+vs
Select Python venv

Indenting Blocks

Manual Indent / Dedent
>> / <<
Indent / dedent current line
V select > / <
Indent / dedent visual selection
>ip / <ip
Indent / dedent inner paragraph
>i{ / <i{
Indent / dedent inside braces
>it / <it
Indent / dedent inside HTML tag
5>>
Indent next 5 lines
Auto-indent (LSP / Treesitter)
==
Auto-indent current line
=ip
Auto-indent inner paragraph
=i{
Auto-indent inside braces (great for functions/classes)
gg=G
Auto-indent entire file
Tip
> < =
Work with any text object — same grammar as d, c, y