You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Paste over selection without losing your yanked text
<leader>d
Normal / Visual
Delete without overwriting the yank register
LSP — Language Features
These only activate when a language server has attached to the buffer (i.e. when you open a supported file type like .ts, .py, .lua, .cpp, etc.).
Key
Mode
Action
K
Normal
Show hover documentation for symbol under cursor
gd
Normal
Go to definition
gD
Normal
Go to declaration
gi
Normal
Go to implementation
go
Normal
Go to type definition
gr
Normal
Show all references
gs
Normal
Show signature help (function parameters)
gl
Normal
Open diagnostics float (show error/warning detail)
<F2>
Normal
Rename symbol across the project
<F3>
Normal / Visual
Format buffer or selection (async)
<F4>
Normal
Code action (quick fixes, imports, etc.)
Git — Gitsigns
Only active when the file is inside a git repository.
A "hunk" is a contiguous block of changed lines.
Key
Mode
Action
]h
Normal
Jump to next hunk (change)
[h
Normal
Jump to previous hunk
<leader>hs
Normal
Stage hunk under cursor
<leader>hr
Normal
Reset hunk under cursor
<leader>hS
Normal
Stage entire buffer
<leader>hu
Normal
Undo last staged hunk
<leader>hR
Normal
Reset entire buffer to HEAD
<leader>hp
Normal
Preview hunk inline
<leader>hb
Normal
Show full git blame for current line
<leader>tb
Normal
Toggle inline blame on every line
File Navigation — Harpoon
Harpoon lets you "pin" files and jump between them instantly without Telescope.
Key
Mode
Action
<leader>a
Normal
Add current file to Harpoon list
<C-e>
Normal
Toggle Harpoon quick menu
<C-p>
Normal
Jump to previous file in Harpoon list
<C-n>
Normal
Jump to next file in Harpoon list
<leader>fl
Normal
Open Harpoon list inside Telescope
Fuzzy Finding — Telescope
Key
Mode
Action
<leader>ff
Normal
Find files in project
<leader>fg
Normal
Live grep — search text across all files
<leader>fb
Normal
Browse open buffers
<leader>fh
Normal
Search Neovim help tags
Completion — nvim-cmp
These work in Insert mode while a completion menu is open.
Note: <C-e> closes the completion menu here, but in Normal mode <C-e> opens the Harpoon menu — no conflict.
Key
Mode
Action
<Tab>
Insert / Select
Select next completion item, or expand / jump through snippet
<S-Tab>
Insert / Select
Select previous item, or jump snippet backward
<CR>
Insert
Confirm selection (only if you explicitly highlighted an item)
<C-Space>
Insert
Force-open the completion menu
<C-e>
Insert
Close / abort the completion menu
<C-b>
Insert
Scroll documentation popup up
<C-f>
Insert
Scroll documentation popup down
Surround — nvim-surround
Surround text with brackets, quotes, tags, or any character pair.
Select inner paragraph (contiguous block of non-blank lines)
vap
Select around paragraph (including surrounding blank lines)
dip
Delete the paragraph your cursor is inside
yap
Copy the whole paragraph (including surrounding blank lines)
Practical Copy-Paste Workflows
-- Copy a whole function body:
1. Place cursor anywhere inside the { }
2. yi{ → yank everything inside the braces
3. Move to destination, press p
-- Copy the entire function including its signature:
1. Place cursor on the opening { of the function body
2. V → start line selection
3. % → jump to matching closing } (selects whole function body)
4. y → yank
5. p → paste
(Note: % finds the nearest bracket — cursor must be on { not on the function keyword)
-- Delete a whole block and re-type it:
1. Place cursor inside { }
2. ci{ → delete contents and enter Insert mode
-- Duplicate a paragraph:
1. yap → yank paragraph
2. } → jump past it
3. p → paste
-- Select then delete lines 10-20:
:10,20d (command mode — fastest way)
-- or visually:
:10 → go to line 10 (or 10G in normal mode)
V → start visual
20G → jump to line 20 (extends selection)
d → delete
-- or count-based:
10G → go to line 10
V10j → select 10 lines down
d → delete
Column / Block Selection (Visual-Block)
Key
Action
<C-v>
Enter Visual-Block mode (select a rectangular column)
<C-v>jj$
Select to end of multiple lines at once
<C-v>I<text>Esc
Insert <text> at the start of every selected line
<C-v>A<text>Esc
Append <text> at the end of every selected line
<C-v>d
Delete a column of characters
Text Objects — The Key to Fast Editing
Text objects are used after an operator (d, y, c, v). i = inner (just the content), a = around (content + delimiters).
Object
Inner (i)
Around (a)
w
word
word + surrounding space
W
WORD (incl. punctuation)
WORD + space
s
sentence
sentence + space
p
paragraph
paragraph + blank lines
"
inside "..."
including the "
'
inside '...'
including the '
`
inside `...`
including the backticks
( or )
inside (...)
including parens
{ or }
inside {...}
including braces
[ or ]
inside [...]
including brackets
< or >
inside <...>
including angle brackets
t
inside HTML tag
including the tags
Examples:
diw → delete word under cursor
ciw → change word (delete + insert mode)
yi" → copy everything inside quotes
da( → delete the entire ( ) including parens
ci{ → delete function body, enter insert mode
vap → visually select the whole paragraph
dt" → delete from cursor to (not including) next "
Editing
Key
Action
x
Delete character under cursor
X
Delete character before cursor
D
Delete from cursor to end of line
C
Change from cursor to end of line
r<char>
Replace single character
R
Enter Replace mode (overwrite characters)
s
Delete character and enter Insert mode
S
Delete entire line and enter Insert mode
cc
Delete current line and enter Insert mode
gu<motion>
Convert to lowercase (e.g. guiw)
gU<motion>
Convert to uppercase (e.g. gUiw)
g~<motion>
Toggle case
=<motion>
Auto-indent
==
Auto-indent current line
Search & Replace
Key / Command
Action
/pattern
Search forward
?pattern
Search backward
n / N
Next / previous match
*
Search word under cursor (forward)
#
Search word under cursor (backward)
:noh
Clear search highlight
:%s/old/new/g
Replace all occurrences in file
:%s/old/new/gc
Replace all with confirmation prompt
:s/old/new/g
Replace on current line only
:10,20s/old/new/g
Replace in lines 10–20
:%s/\<word\>/new/g
Replace whole word only (not partial matches)
Marks & Registers
Key
Action
m<a-z>
Set a local mark (e.g. ma)
m<A-Z>
Set a global mark (persists across files)
'<letter>
Jump to marked line
`<letter>
Jump to exact mark position
:marks
List all marks
"<letter>y
Yank into named register
"<letter>p
Paste from named register
"0p
Paste last yank (not overwritten by delete)
"+y
Yank to system clipboard
"+p
Paste from system clipboard
:registers
Show all register contents
Folds
Key
Action
za
Toggle fold under cursor
zo
Open fold
zc
Close fold
zR
Open all folds in file
zM
Close all folds in file
zr
Open one fold level
zm
Close one fold level
Visual Mode
Key
Action
v
Character-wise visual mode
V
Line-wise visual mode
<C-v>
Block-wise (column) visual mode
gv
Reselect previous selection
o
Move to other end of selection
d
Delete selection
y
Copy (yank) selection
c
Change (delete + insert)
> / <
Indent / un-indent
~
Toggle case of selection
gu / gU
Lowercase / uppercase selection
J
Join selected lines
=
Auto-indent selection
Insert Mode
Key
Action
Esc or <C-c>
Exit Insert mode
<C-w>
Delete word before cursor
<C-u>
Delete from cursor to start of line
<C-h>
Delete character before cursor (same as Backspace)
<C-t>
Indent current line
<C-d>
Un-indent current line
<C-r><register>
Paste from a register (e.g. <C-r>" pastes default register)