Neovim Commands Cheat Sheet (2026)
Complete reference for essential Neovim commands and shortcuts
Start Building with Hypereal
Access Kling, Flux, Sora, Veo & more through a single API. Free credits to start, scale to millions.
No credit card required • 100k+ developers • Enterprise ready
Neovim Commands Cheat Sheet (2026)
Neovim has become the terminal editor of choice for developers who want speed, extensibility, and full keyboard-driven workflows. Whether you are new to Neovim or switching from Vim, this cheat sheet covers every essential command you need in 2026.
This reference is organized by task so you can find what you need quickly.
Getting Started
Installation
# macOS
brew install neovim
# Ubuntu/Debian
sudo apt install neovim
# Arch Linux
sudo pacman -S neovim
# Windows (Scoop)
scoop install neovim
# From source (latest)
git clone https://github.com/neovim/neovim.git
cd neovim && make CMAKE_BUILD_TYPE=Release
sudo make install
Check your version:
nvim --version
Configuration File Location
Neovim uses Lua for configuration (not .vimrc):
~/.config/nvim/init.lua
Or the traditional Vim format:
~/.config/nvim/init.vim
Modes
Neovim has several modes. Understanding them is fundamental:
| Mode | Key to Enter | Purpose |
|---|---|---|
| Normal | Esc or Ctrl+[ |
Navigate and run commands |
| Insert | i, a, o |
Type and edit text |
| Visual | v, V, Ctrl+v |
Select text |
| Command | : |
Execute Ex commands |
| Replace | R |
Overwrite text |
| Terminal | :terminal |
Embedded terminal |
Movement Commands
Basic Motion
| Command | Action |
|---|---|
h |
Move left |
j |
Move down |
k |
Move up |
l |
Move right |
w |
Jump to start of next word |
W |
Jump to start of next WORD (whitespace-delimited) |
b |
Jump to start of previous word |
B |
Jump to start of previous WORD |
e |
Jump to end of word |
E |
Jump to end of WORD |
0 |
Jump to start of line |
^ |
Jump to first non-blank character |
$ |
Jump to end of line |
Advanced Motion
| Command | Action |
|---|---|
gg |
Go to first line of file |
G |
Go to last line of file |
{number}G |
Go to specific line number |
{ |
Jump to previous paragraph |
} |
Jump to next paragraph |
% |
Jump to matching bracket |
f{char} |
Jump forward to character |
F{char} |
Jump backward to character |
t{char} |
Jump to just before character |
T{char} |
Jump back to just after character |
; |
Repeat last f/F/t/T motion |
, |
Repeat last f/F/t/T motion in reverse |
Ctrl+d |
Scroll down half page |
Ctrl+u |
Scroll up half page |
Ctrl+f |
Scroll down full page |
Ctrl+b |
Scroll up full page |
zz |
Center cursor line on screen |
zt |
Move cursor line to top of screen |
zb |
Move cursor line to bottom of screen |
Editing Commands
Insert Mode Entry
| Command | Action |
|---|---|
i |
Insert before cursor |
I |
Insert at beginning of line |
a |
Append after cursor |
A |
Append at end of line |
o |
Open new line below |
O |
Open new line above |
s |
Delete character and enter insert mode |
S |
Delete entire line and enter insert mode |
C |
Delete from cursor to end of line and enter insert mode |
Normal Mode Editing
| Command | Action |
|---|---|
x |
Delete character under cursor |
X |
Delete character before cursor |
dd |
Delete entire line |
D |
Delete from cursor to end of line |
dw |
Delete word |
d$ |
Delete to end of line |
d0 |
Delete to start of line |
yy |
Yank (copy) entire line |
yw |
Yank word |
y$ |
Yank to end of line |
p |
Paste after cursor |
P |
Paste before cursor |
u |
Undo |
Ctrl+r |
Redo |
. |
Repeat last change |
r{char} |
Replace single character |
R |
Enter replace mode |
J |
Join current line with next |
~ |
Toggle case of character |
>> |
Indent line |
<< |
Unindent line |
== |
Auto-indent line |
Text Objects
Text objects are one of Neovim's most powerful features. Use them with operators like d, c, y, v:
| Command | Action |
|---|---|
diw |
Delete inner word |
daw |
Delete a word (including surrounding space) |
di" |
Delete inside double quotes |
da" |
Delete including double quotes |
di( |
Delete inside parentheses |
da( |
Delete including parentheses |
di{ |
Delete inside curly braces |
di[ |
Delete inside square brackets |
dit |
Delete inside HTML/XML tag |
dip |
Delete inner paragraph |
dap |
Delete a paragraph |
ci" |
Change inside double quotes |
ca( |
Change around parentheses |
vi{ |
Visually select inside braces |
yit |
Yank inside tag |
Search and Replace
| Command | Action |
|---|---|
/{pattern} |
Search forward |
?{pattern} |
Search backward |
n |
Next search result |
N |
Previous search result |
* |
Search forward for word under cursor |
# |
Search backward for word under cursor |
:%s/old/new/g |
Replace all occurrences in file |
:%s/old/new/gc |
Replace all with confirmation |
:s/old/new/g |
Replace all on current line |
:{range}s/old/new/g |
Replace in line range |
Visual Mode
| Command | Action |
|---|---|
v |
Enter character-wise visual mode |
V |
Enter line-wise visual mode |
Ctrl+v |
Enter block (column) visual mode |
gv |
Reselect last visual selection |
o |
Move to other end of selection |
> |
Indent selection |
< |
Unindent selection |
= |
Auto-indent selection |
d |
Delete selection |
y |
Yank selection |
c |
Change selection |
U |
Uppercase selection |
u |
Lowercase selection |
Buffers, Windows, and Tabs
Buffers
| Command | Action |
|---|---|
:e {file} |
Open file in new buffer |
:ls |
List all buffers |
:bn |
Next buffer |
:bp |
Previous buffer |
:bd |
Delete (close) buffer |
:b {number} |
Go to buffer by number |
:b {name} |
Go to buffer by partial name |
Windows (Splits)
| Command | Action |
|---|---|
:sp {file} |
Horizontal split |
:vsp {file} |
Vertical split |
Ctrl+w s |
Horizontal split |
Ctrl+w v |
Vertical split |
Ctrl+w h/j/k/l |
Navigate between splits |
Ctrl+w H/J/K/L |
Move split to edge |
Ctrl+w = |
Equal size splits |
Ctrl+w _ |
Maximize height |
Ctrl+w | |
Maximize width |
Ctrl+w q |
Close split |
Ctrl+w o |
Close all splits except current |
Tabs
| Command | Action |
|---|---|
:tabnew {file} |
Open file in new tab |
:tabn or gt |
Next tab |
:tabp or gT |
Previous tab |
:tabclose |
Close current tab |
:tabonly |
Close all tabs except current |
File Operations
| Command | Action |
|---|---|
:w |
Save file |
:w {filename} |
Save as |
:wq or ZZ |
Save and quit |
:q |
Quit |
:q! or ZQ |
Quit without saving |
:wa |
Save all buffers |
:qa |
Quit all |
:qa! |
Quit all without saving |
:e! |
Reload file from disk |
Marks and Jumps
| Command | Action |
|---|---|
m{a-z} |
Set local mark |
m{A-Z} |
Set global mark (across files) |
`{mark} |
Jump to mark (exact position) |
'{mark} |
Jump to mark (line start) |
`` |
Jump to last position before jump |
Ctrl+o |
Jump to older position in jump list |
Ctrl+i |
Jump to newer position in jump list |
Macros
| Command | Action |
|---|---|
q{register} |
Start recording macro to register (a-z) |
q |
Stop recording |
@{register} |
Play macro |
@@ |
Replay last macro |
{count}@{register} |
Play macro N times |
Registers
| Command | Action |
|---|---|
"{register}y{motion} |
Yank into specific register |
"{register}p |
Paste from specific register |
:reg |
Show all registers |
"0p |
Paste last yank (not delete) |
"+y |
Yank to system clipboard |
"+p |
Paste from system clipboard |
"_d |
Delete without saving to register (black hole) |
Built-in LSP (Language Server Protocol)
Neovim has built-in LSP support. Common keybindings (default or typical config):
-- init.lua LSP keybindings
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = 'Go to definition' })
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { desc = 'Go to declaration' })
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = 'Go to implementation' })
vim.keymap.set('n', 'gr', vim.lsp.buf.references, { desc = 'Find references' })
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = 'Hover documentation' })
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, { desc = 'Rename symbol' })
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, { desc = 'Code action' })
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Previous diagnostic' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Next diagnostic' })
vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format({ async = true }) end, { desc = 'Format' })
Essential Lua Configuration
Basic init.lua Setup
-- Line numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Indentation
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
-- Search
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- Appearance
vim.opt.termguicolors = true
vim.opt.signcolumn = "yes"
vim.opt.scrolloff = 8
vim.opt.wrap = false
-- Performance
vim.opt.updatetime = 250
vim.opt.timeoutlen = 300
-- Leader key
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Clipboard
vim.opt.clipboard = "unnamedplus"
-- Splits
vim.opt.splitright = true
vim.opt.splitbelow = true
Plugin Manager (lazy.nvim)
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Telescope (fuzzy finder)
{ "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
-- Treesitter (syntax highlighting)
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
-- LSP
{ "neovim/nvim-lspconfig" },
-- Autocompletion
{ "hrsh7th/nvim-cmp" },
-- File explorer
{ "nvim-neo-tree/neo-tree.nvim" },
})
Telescope Commands (Fuzzy Finder)
If you use Telescope (the most popular Neovim fuzzy finder):
| Command | Action |
|---|---|
<leader>ff |
Find files |
<leader>fg |
Live grep (search in files) |
<leader>fb |
Browse buffers |
<leader>fh |
Help tags |
<leader>fr |
Recent files |
<leader>fd |
Diagnostics |
Terminal Mode
| Command | Action |
|---|---|
:terminal |
Open terminal in current buffer |
:sp | terminal |
Open terminal in horizontal split |
Ctrl+\\ Ctrl+n |
Exit terminal mode to normal mode |
i or a |
Re-enter terminal mode from normal mode |
Useful Ex Commands
| Command | Action |
|---|---|
:!{command} |
Run shell command |
:r !{command} |
Insert output of shell command |
:r {file} |
Insert contents of file |
:sort |
Sort selected lines |
:sort u |
Sort and remove duplicates |
:%!jq . |
Format JSON using jq |
:noh |
Clear search highlighting |
:set spell |
Enable spell checking |
:checkhealth |
Run health check |
Frequently Asked Questions
What is the difference between Vim and Neovim? Neovim is a modernized fork of Vim with built-in LSP support, Lua scripting, better defaults, and an async architecture. It is fully compatible with most Vim plugins while adding features like a built-in terminal and tree-sitter integration.
Should I use init.lua or init.vim?
Use init.lua. Lua is faster, more readable, and all modern Neovim plugins use Lua. The Vimscript format still works but is considered legacy.
How do I exit Neovim?
Type :q to quit, :wq to save and quit, or :q! to quit without saving. You can also use ZZ (save and quit) or ZQ (quit without saving).
Wrapping Up
This cheat sheet covers the commands you will use daily in Neovim. The key to mastery is building muscle memory through practice -- start with basic motions and editing, then gradually add text objects, macros, and LSP features to your workflow.
If you are a developer building AI-powered applications and want to generate images, video, or avatars from your Neovim terminal, try Hypereal AI free -- 35 credits, no credit card required. The REST API works perfectly with curl or any HTTP client you prefer.
Related Articles
Start Building Today
Get 35 free credits on signup. No credit card required. Generate your first image in under 5 minutes.
