Neovim for Beginners.
// learn it once, reference forever.
A practical Neovim manual for getting productive quickly. Keep this tab open while you build muscle memory.
$ nvim notes.md
-- NORMAL --
(normal) i -> insert mode
(insert) Esc -> normal mode
(normal) :wq -> save and quit
// contents
The 30-second model
Install and launch
Quit without panic
Movement and navigation
Editing and text objects
Search and replace
Buffers, windows, tabs
Minimal Neovim config
Map props and resources
Practice plan
Cheat sheet
The 30-second model
Neovim is mode-based editing. You do not type all the time. You switch between modes depending on intent.
| Mode | What it does | How to enter | How to leave |
|---|---|---|---|
| Normal | Navigate and run commands | Esc | Use a mode key |
| Insert | Type text | i, a, o | Esc |
| Visual | Select text | v, V, Ctrl-v | Esc |
| Command line | Run ex commands | : | Enter or Esc |
// one rule that fixes most beginner pain
If things feel weird, press Esc a couple of times to return to Normal mode, then continue.
Install and launch
fedora
sudo dnf install -y neovim
ubuntu / debian / mint
sudo apt install -y neovim
arch
sudo pacman -S neovim
launch
nvim # open editor nvim file.txt # open file nvim . # open current folder nvim +Tutor # interactive tutorial
Quit without panic
normal mode then :
:w # save :q # quit (fails if unsaved changes) :wq # save and quit :q! # quit and discard changes :x # save and quit only if changed
// emergency exit pattern
Esc then :q! then Enter. Done.
Movement and navigation
Fast Neovim use is mostly movement. Learn this set first.
By character and line
h j k l left down up right 0 line start ^ first non-blank $ line end gg file top G file bottom 42G go to line 42
By word and block
w next word start b previous word start e word end { previous paragraph } next paragraph % matching (), {}, []
// multiplier rule
Prefix many motions with a number: 5j (down five lines), 3w (forward three words), 10G (line ten).
Editing and text objects
insert
i insert before cursor a insert after cursor I insert at line start A insert at line end o new line below O new line above
delete / change / copy
x delete character dd delete line dw delete word forward d$ delete to end of line cc change whole line cw change word yy yank (copy) line p paste after cursor P paste before cursor
undo / redo / repeat
u undo Ctrl-r redo . repeat last edit command
// text object pattern
Most editing is verb + motion. Examples: daw (delete a word), ci" (change inside quotes), di( (delete inside parentheses).
Search and replace
search
/term search forward ?term search backward n next match N previous match * search word under cursor
replace
:%s/old/new/g replace all in file :%s/old/new/gc replace all with confirm :10,30s/old/new/g replace in line range
Buffers, windows, tabs
Files and buffers
:e file.txt open file :ls list buffers :bnext next buffer :bprev previous buffer :bd close buffer
Windows and tabs
:split horizontal split :vsplit vertical split Ctrl-w h/j/k/l move between splits :tabnew new tab gt next tab gT previous tab
Minimal Neovim config
If you only do one config pass, do this one.
config location
mkdir -p ~/.config/nvim nvim ~/.config/nvim/init.lua
~/.config/nvim/init.lua
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.smartindent = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.clipboard = "unnamedplus"
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>w", "<cmd>w<CR>")
vim.keymap.set("n", "<leader>q", "<cmd>q<CR>")
vim.keymap.set("n", "<leader>h", "<C-w>h")
vim.keymap.set("n", "<leader>l", "<C-w>l")
// keep it boring at first
Skip heavy plugin setups until movement and editing feel natural. Core Neovim skills compound faster than plugin hunting.
Mad props and resources
Mad props to ThePrimeagen - he is really good at explaining Vim motions in a way that makes them usable fast.
- ThePrimeagen video: https://www.youtube.com/watch?v=X6AR2RMB5tE
- ThePrimeagen video: https://www.youtube.com/watch?v=w7i4amO_zaE&t=189s
Practice plan (7 days)
- Day 1: Only use h j k l, i, Esc,
:wq. - Day 2: Add word movement: w, b, e, 0, $.
- Day 3: Add editing:
dd,yy,p,cw,u,Ctrl-r. - Day 4: Search and replace with
/,n, and:%s/.../.../gc. - Day 5: Practice splits and buffers in a real project.
- Day 6: Add 3 keymaps you will use daily.
- Day 7: Work for one full session without arrow keys.
Cheat sheet
daily core
i / a / o enter insert mode Esc back to normal mode :wq save and quit :q! quit without saving w b e word movement 0 ^ $ line movement gg G top / bottom of file dd yy p delete, yank, paste u Ctrl-r . undo, redo, repeat /term n N search + next/prev :split :vsplit split windows Ctrl-w h/j/k/l navigate windows
// built-in help
:help opens docs. Examples: :help motion.txt, :help usr_03.txt, :help :s.