Neovim (Nvim) Keyboard Shortcuts: The Complete Reference Guide

Master Neovim modal editing, windows, and buffers with this complete keyboard shortcuts cheat sheet. Boost your terminal editing speed.
From Startup to Scale: How Tech Services Propel Business Growth

⌨️ Neovim Keyboard Shortcuts

The Power of Modal Editing

Neovim relies heavily on Modes (Normal, Insert, Visual, Command-line). Always make sure you are in Normal Mode (press Esc) before executing navigation, yank, or window commands. By default, <Leader> refers to your custom configured prefix key (commonly mapped to Space or \).

⚙️ General & Core Essentials

Shortcut Mode Action
i / a Normal Enter Insert mode before / after the cursor
I / A Normal Enter Insert mode at the beginning / end of the line
Esc / Ctrl + [ Any Return to Normal Mode
: Normal Enter Command-line mode
:w Command Save current file
:q Command Quit current window
:wq / :x Command Save and quit
:q! Command Force quit without saving

🧭 Basic Movement (Normal / Visual Mode)

Shortcut Action
h / j / k / l Move cursor Left / Down / Up / Right
w / b Move to start of next word / previous word
e / ge Move to end of next word / previous word
0 / ^ Move to absolute start of line / first non-blank character
$ Move to end of line
g g / G Move to first line / last line of the document
H / M / L Move cursor to High (top) / Middle / Low (bottom) of screen
Ctrl + u / Ctrl + d Scroll screen Up half-page / Down half-page
Ctrl + b / Ctrl + f Scroll screen Up full-page / Down full-page

📝 Editing & Text Manipulation

Shortcut Mode Action
o / O Normal Open new line below / above and enter Insert mode
x Normal Delete character under the cursor
r Normal Replace a single character under the cursor
R Normal Enter Replace mode (overwrite text)
d d Normal Delete (cut) current line
d [motion] Normal Delete text defined by motion (e.g., d w deletes word)
c c Normal Change (delete and insert) current line
c [motion] Normal Change text defined by motion (e.g., c i w change inside word)
~ Normal Toggle case of character under cursor
. Normal Repeat last editing command
The Dot Command

The . shortcut is one of Neovim's biggest multipliers. It automatically repeats your last editing operation (like a change, deletion, or insert block), letting you bypass repetitive macro writing for simple tasks.

📋 Copy (Yank), Cut & Paste

Shortcut Mode Action
y y Normal Yank (copy) current line
y [motion] Normal Yank text defined by motion
p Normal Paste clipboard content after cursor / below line
P Normal Paste clipboard content before cursor / above line
"+y Visual Yank selection directly to system clipboard
"+p Normal Paste directly from system clipboard

↩️ Undo & Redo

Shortcut Mode Action
u Normal Undo last action
Ctrl + r Normal Redo last undone action
U Normal Undo all recent changes on the current line

🔍 Search & Replace

Shortcut Mode Action
/pattern Normal Search forward for pattern
?pattern Normal Search backward for pattern
n / N Normal Repeat search in same / opposite direction
* / # Normal Search forward / backward for word under cursor
:%s/old/new/g Command Replace all occurrences of old with new in file
:%s/old/new/gc Command Replace all occurrences with confirmation prompt

🎭 Visual Mode (Selection)

Shortcut Mode Action
v Normal Enter character-wise Visual mode
V Normal Enter line-wise Visual mode
Ctrl + v Normal Enter block-wise Visual mode (column selection)
o Visual Move cursor to opposite end of current selection
> / < Visual Indent / Outdent selected text

🗂️ Buffers & Tabs Management

Shortcut Mode Action
:bnext or :bn Command Switch to next open buffer
:bprev or :bp Command Switch to previous open buffer
:bd Command Delete current buffer (close file without quitting)
:ls Command List all active buffers
:tabnew [file] Command Open a file in a new tab
g t / g T Normal Go to next tab / previous tab

🪟 Window Splits & Layouts

Shortcut Mode Action
:vsplit or :vsp Command Split window vertically
:split or :sp Command Split window horizontally
Ctrl + w h Normal Move focus to Left window split
Ctrl + w j Normal Move focus to Down window split
Ctrl + w k Normal Move focus to Up window split
Ctrl + w l Normal Move focus to Right window split
Ctrl + w w Normal Cycle focus between open splits
Ctrl + w q Normal Close focused split window
Ctrl + w = Normal Balance all split window sizes equally

🚀 Modern Neovim Defaults (LSP & Diagnostics)

Distro Specific Configurations

These are Neovim's built-in Lua LSP mappings. If you use custom pre-configured frameworks like LazyVim, AstroNvim, or NvChad, these are heavily optimized and often remapped to use structural sequences starting with <Leader>.

Shortcut Action
g d Go to Definition
g D Go to Declaration
g r Show LSP References
g i Go to Implementation
K Show LSP documentation hover information
Ctrl + x Ctrl + o Trigger Omni-completion (built-in autocomplete)
[ d / ] d Move to Previous / Next diagnostic error or warning
:lua vim.lsp.buf.code_action() Trigger code action / quick fix panel
:lua vim.lsp.buf.rename() Rename all occurrences of symbol
Content Creator

Ghostwriter for the dark web. I publish step-by-step ransomware guides, exploit breakdowns, and deep-dive articles on how to dismantle corporate firewalls.