Thirty Vim Commands, Verified One by One — Including the Two the Video Gets Wrong

A ten-minute tour of the Vim commands worth knowing, from :q to macros, with a genuinely well-chosen progression: search → change → repeat → registers → automate. Every command below is listed with what it does and why you would reach for it, and every one was executed against a real Neovim 0.12.1 to confirm the behaviour described. Two claims did not survive that test — one about how numbered registers fill, one about the system clipboard — and both are the kind that quietly waste an afternoon.

30 Vim commands you NEED TO KNOW (in just 10 minutes)
📺 typecraft ⏱️ 10:26 📅 26 April 2024 👁️ 292,990
Vim Neovim Registers Macros Text objects Verified locally

📌 How this was checked

This video is from April 2024 — over two years old at the time of writing. For most technology that would mean checking what has changed. For Vim it means almost nothing has: the commands below are decades old and the video's age is not a defect.

But "probably still true" is not verification. Every command in this article was run against Neovim 0.12.1 and cross-read against :help change.txt and :help provider.txt from that installation, using headless sessions with -u NONE so no personal configuration could alter the result.

Twenty-eight behaved exactly as described. Two did not, and they are covered in §7 and §9.
The video's real strength is its ordering, which is worth naming because most command lists have none: search → change → repeat → make it repeatable → automate the repetition. Each section makes the next one useful. That is a curriculum, not a list, and it is why this one has 292,990 views while equivalent lists do not.

🚪 Opening and quitting 0:14

CommandWhat it doesWhy you need it
nvim <file>Opens the file in NeovimThe entry point. vim <file> for classic Vim
:Opens the command line (Ex mode)Every colon command starts here — it is a mode, not a prefix
:qQuitThe single most-searched Vim question on the internet
"To quit Neovim it is colon-q. Colon opens the command prompt and q stands for quit. Hit enter and you're out. I just saved you a lot of time, you're welcome."
Worth adding, because the video does not: :q refuses when the buffer has unsaved changes. The variants you will actually need within your first hour:
:wWrite (save) without quitting
:wqWrite, then quit
:q!Quit, discarding unsaved changes — the ! means "I mean it"
:qa!Quit all windows/buffers, discarding changes
Teaching :q without :q! leaves the beginner stuck on the exact error that made them search in the first place.

🧭 Movement — hjkl 0:44

KeyDirectionMnemonic
hLeftLeftmost of the four keys
jDownThe letter has a descender — it hangs down
kUpThe letter has an ascender
lRightRightmost of the four
Why this exists at all — the video treats it as assumed knowledge, which is fair, but the reason is worth one line: the ADM-3A terminal Bill Joy used to write vi had the arrows printed on those keys. It is not ergonomic theory; it is hardware archaeology that turned out to keep your hand on the home row.

His mnemonic — "left, down, up, right" = ladder — is as good as any.

🔍 Search: *, n, N 1:04

CommandWhat it doesWhy you need it
*Searches forward for the word currently under the cursorNo typing. Put the cursor on a variable, press *, and you are navigating its every use
nJump to the next matchForward through the results
NJump to the previous matchBackward — capital reverses direction, a pattern that recurs throughout Vim
Verified. * searches for the word under the cursor with word boundaries applied, so searching post will not match inside composting. Neovim's help confirms the whole-word behaviour.
Three the video skips that belong in the same breath:
#Like *, but searches backward for the word under the cursor
g*Same as * without word boundaries — will match inside longer words
/patternThe general forward search. ?pattern searches backward
g* in particular saves you the moment you want user to also match username.

✏️ Change, text objects, dot 1:28

This is the section that teaches Vim's actual grammar rather than a list of keystrokes.

CommandWhat it doesWhy you need it
cThe change operator — deletes something, then enters insert modeAn operator is incomplete on its own; it waits for a target
iwThe text object "inner word" — the word under the cursor, excluding surrounding whitespaceThe target. Cursor can be anywhere in the word; you do not need to reach its start
ciwChange inner word: delete the word, start typing the replacementThe single highest-value keystroke in this video
.Repeat the last changeTurns one edit into a reusable action
"All I have to do is hit n to go to my next match for that previous word, and to replay what I just did previously I can just hit dot."
The *ciwn. loop is the real lesson of the video, and it deserves naming explicitly because it generalises: find, change once, jump, repeat. You review each occurrence as you go, which is exactly what a blind global substitution denies you.

The grammar underneath is operator + text object, and once you have it, the vocabulary multiplies without memorisation:
diwDelete inner word (same target, different operator)
yiwYank inner word
ci"Change everything inside the double quotes
ci(Change everything inside the parentheses
cawChange a word — a instead of i includes the trailing whitespace
ccChange the whole line
Four operators × a dozen text objects is roughly fifty commands you never had to learn individually.

🔁 Substitute: :%s 2:04

Broken into its parts, because the video reads it out as one string and the parts are independently useful:

PieceMeaning
:Enter the command line
%Range: the entire file. Omit it and you affect only the current line
sThe substitute command
/old/new/Pattern to find, then replacement. old is a regular expression
gFlag: global — replace every occurrence on each line, not just the first
cFlag: confirm — prompt before each replacement
:%s/post/poops/g     " every occurrence in the file, no questions asked
:%s/post/poops/gc    " same, but ask about each one — y / n / a / q / l
The confirm flag is the one to internalise. The video demonstrates exactly why: it wanted to change post but not PostsController, and c is what let it skip that one. A bare /g on a real codebase is how you rename something you did not mean to rename.

A common point of confusion worth stating plainly: the % and the g do different jobs. % is which lines; g is how many times per line. Without g, only the first match on each line changes.
One correction, and it is the transcript's fault rather than the video's: local transcription rendered "the :s command" as "the said command" throughout. There is no said command in Vim. The command is :s, short for substitute.

📋 Visual mode, yank, paste 3:04

CommandWhat it doesWhy you need it
vEnter visual mode — select text by movingLets you see the target before acting on it
viwVisually select the inner wordSame text object as ciw, different operator — the grammar again
yYank (copy) the selection into a registerVim's copy. It does not touch the system clipboard by default — see §9
pPaste after the cursorP pastes before — capital reverses, as with n/N
Why he prepends v rather than using yiw directly: visual mode gives you confirmation. yiw yanks silently and you find out whether you got the right thing when you paste. For destructive or ambiguous targets, seeing the highlight first is worth the extra keystroke — and once you trust the text object, you drop the v.

Two more visual modes complete the set:
VVisual line mode — select whole lines
Ctrl-vVisual block mode — rectangular selection, for columns
yyYank the current line (also written Y)
ddDelete the current line — and yes, it yanks it too

🗄️ Registers — and the error 4:54

The concept is correct and important: Vim has dozens of named clipboards, and :reg shows them all.

CommandWhat it doesWhy you need it
:regList every register and its contentsThe only way to see what you actually have copied
"3pPaste from register 3The " prefix means "the next character names a register"
"7yYank into register 7Deliberate storage — park something where the next yank cannot clobber it
"7pPaste from register 7Retrieve it later, whatever you copied in between
The named-register commands verified exactly. Running "7yy in a clean Neovim session and then :registers 7 shows the yanked line sitting in register 7. Explicit registers work precisely as the video demonstrates.
But the explanation of how the numbered registers fill on their own is wrong. The video says:

"Typically it starts at zero and then increments by one for every action you do. So if I yanked one thing and then changed another thing, the previous thing I yanked should be in register zero. If I keep going from there it'll go to register one, register two, etc."

That describes a rolling history of yanks. It is not what Vim does. From :help change.txt, verbatim:

"Numbered register 0 contains the text from the most recent yank command… Numbered register 1 contains the text deleted by the most recent delete or change command… With each successive deletion or change, Vim shifts the previous contents of register 1 into register 2, 2 into 3, and so forth."
Confirmed by execution. Two headless Neovim sessions on an identical four-line file:
Actions"0"1"2"3
yy yy yy (three yanks)charlie
dd dd dd (three deletes)charliecharliebravoalpha
Three consecutive yanks leave registers 1–3 untouched. Only "0 changes, and each yank overwrites the last. The 1–9 stack is a delete history, not a yank history.
Why the distinction is practical, not pedantic. Believing the video's version, you would yank three things and expect to retrieve all three from "0, "1, "2. Only the last survives — the first two are gone. The correct mental model is:
  • "0 — your most recent yank, safe from deletes
  • "1"9 — your last nine deletions, newest first
  • "" — the unnamed register: whatever the last yank or delete produced. This is what a bare p pastes
  • "a"z — named registers you control. Uppercase "A appends instead of overwriting
"0p is the fix for Vim's most common frustration: yank a word, delete another word to make room, press p, and get the deleted text back instead of what you copied. p reads "", which the delete overwrote. "0p reads the yank.
Neovim 0.12 ships a documented recipe for the behaviour the video describes — a TextYankPost autocommand that shifts yanks through registers 1–9, listed under *yankring* in :help change.txt. Its existence is itself proof that the default does not work that way.

⭐ Special registers 6:20

CommandWhat it doesWhy you need it
"+yYank into the system clipboard registerCopy out of Vim into any other application
"+pPaste from the system clipboardThe reverse direction
"%pPaste the current file's name% is read-only and always holds the open file's path
:let @+ = @%Copy the filename into the clipboard registerPuts the path on your system clipboard to paste elsewhere
Both verified. getreg("%") in a headless session on /tmp/vt3.txt returns vt3.txt. The :let @x = @y form is the general way to copy one register into another — @ is how registers are addressed in expressions, where " is how they are addressed in normal mode.
Other read-only registers worth knowing, none of which the video covers:
"/Your last search pattern
":Your last Ex command — @: re-runs it
".The last text you typed in insert mode
"_The black hole. "_d deletes without touching any register
"_d is the other half of the "0p fix in §7 — delete into the void and your yank survives untouched.

📎 The clipboard error 6:32

"The one that I like to use all the time is the star register, which is the system clipboard. Now it's the star register in macOS, but in Linux it's the plus register. I don't know off the top of my head what it is in Windows."
This frames an X11 concept as an operating-system difference, and it is not one. Neovim's own :help provider.txt:

"There are three documented X11 selections: PRIMARY, SECONDARY, and CLIPBOARD… Nvim's X11 clipboard providers only use the PRIMARY and CLIPBOARD selections, for the "* and "+ registers, respectively."

"+ is CLIPBOARD — what Ctrl-C/Ctrl-V uses everywhere.
"* is PRIMARY — the X11 middle-click selection, which has no equivalent outside X11.
The practical rule, and it is simpler than the video's:
  • Use "+ everywhere. It is the clipboard on Linux, macOS and Windows alike.
  • On macOS and Windows, "* and "+ are the same thing — which is why his macOS demo works.
  • On Linux/X11 they differ, and this is where the video's advice actively misleads: it tells Linux users to use + (correct) but implies macOS users need * (unnecessary), leaving the impression that a shared config must branch on OS. It does not.
Note the video's own demo contradicts its rule — he is on macOS and types "+y, the register he just said was for Linux. It works, because on macOS they are aliases.
To his credit he flags his own uncertainty about Windows and invites correction — "I could be wrong, feel free to correct me in the comments." Marking the boundary of your knowledge is the right instinct; the error is in the part he stated confidently.

🎬 Macros 8:20

The strongest section, and the one that justifies everything before it. The problem is concrete: an array pasted into a Ruby file needs every line quoted and comma-terminated.

CommandWhat it doesWhy you need it
qhStart recording into register hq + any letter. Neovim shows recording @h in the status line
qStop recordingSame key, no register — it toggles
@hReplay the macro in register hEvery keystroke you recorded, replayed exactly
5@hReplay it five timesCounts work on macros like they work on motions
@@Replay the last macro againNot in the video. Saves naming the register every time
Verified end to end. A headless session recorded qh → insert " at line start → append ", at line end → move down → q, then replayed with 2@h. The output file showed the transformation applied and the recording correctly captured. The macro register mechanism works exactly as described.
The insight that makes macros work, and the video states it well: "make sure I keep in mind that these changes can be replayed on every single line."

A macro is only as reusable as it is position-independent. That is why his recording ends by moving to the next line and back to column zero — so replay number two starts exactly where replay number one started, relative to its own line. Macros that fail usually fail here, not in the editing itself.

Two refinements worth knowing:
  • Macros are just registers. :reg h prints your macro as text — and since it is text, you can yank it, edit it, and put it back with :let @h = '...' to fix a mistake without re-recording.
  • 100@h is safe. A macro stops when a command in it fails — hitting the end of the file, say. You do not need to count the lines; over-count deliberately.

📖 The full command table

Everything the video demonstrates, in order, plus the closely-related commands it omits. All verified against Neovim 0.12.1.

#CommandPurposeStatus
1nvim <file>Open a file for editingVerified
2:Open the Ex command lineVerified
3:qQuit (refuses if unsaved)Verified
4h j k lLeft, down, up, rightVerified
5*Search forward for the word under the cursorVerified
6nNext search matchVerified
7NPrevious search matchVerified
8cChange operator — delete, then insertVerified
9iwText object: inner wordVerified
10ciwChange the word under the cursorVerified
11.Repeat the last changeVerified
12:%s/a/b/gReplace every a with b in the fileVerified
13:%s/a/b/gcSame, confirming each replacementVerified
14vEnter visual (character) modeVerified
15viwVisually select the inner wordVerified
16yYank (copy) into a registerVerified
17pPaste after the cursorVerified
18:regList all registers and contentsVerified
19"3pPaste from numbered register 3Verified
20"7yYank into named register 7Verified
21"7pPaste from register 7Verified
22"0–"9 auto-fillClaimed: a rolling yank historyWrong — §7
23"+yYank to the system clipboardVerified
24"* vs "+Claimed: macOS vs LinuxWrong — §9
25"%pPaste the current filenameVerified
26:let @+ = @%Filename → system clipboardVerified
27qhStart recording a macro into hVerified
28qStop recordingVerified
29@hReplay the macroVerified
305@hReplay it five timesVerified

Worth adding to the thirty

:q!Quit and discard changes — the one a beginner needs first
:wqSave and quit
u / Ctrl-rUndo / redo. Astonishingly, not in the video
#Search backward for the word under the cursor
g** without word boundaries — matches inside longer words
ci" ci( citChange inside quotes / parens / an HTML tag
V / Ctrl-vVisual line mode / visual block mode
"0pPaste your last yank, even after deleting something
"_dDelete into the black hole, preserving your yank
@@Replay the last macro without naming it
:help <topic>The command that makes the other thirty discoverable
The most surprising omission is undo. A video aimed at people learning Vim covers macros and special registers but never mentions u. Every command in §4 and §5 is destructive, and the beginner following along has no stated way back.

🔍 Claims checked

ClaimResult
:q quits; : opens the command lineVerified
hjkl = left, down, up, rightVerified
* searches the word under the cursor; n/N cycleVerified — whole-word matching confirmed
ciw changes the inner word; . repeatsVerified
:%s/a/b/g and the c confirm flagVerified
viw, y, pVerified
:reg lists registers; "7y / "7p workVerified by execution in a clean session
"Registers start at 0 and increment by one for every action"Wrong. "0 = last yank only. "1"9 = delete history. Three consecutive yanks left 1–3 empty in a live test
"* on macOS, + on Linux"Wrong framing. "+ = CLIPBOARD, "* = X11 PRIMARY. Use "+ on every platform. His own macOS demo uses "+
"% holds the current filenameVerified — getreg("%") returned vt3.txt
:let @+ = @% copies the filename to the clipboardVerified — correct expression-register syntax
qhq records; @h replays; 5@h repeatsVerified end to end in a headless session
Undo (u) is coveredNot mentioned once in a beginner video full of destructive commands
Video is current despite being from April 2024Yes — verified against Neovim 0.12.1. Vim's core commands have not moved
Method note. YouTube caption routes were unavailable, so the transcript was produced locally with Whisper large-v3-turbo — 109 segments across the full 10:19. It rendered the :s (substitute) command as "the said command" throughout, Neovim as "neo vim", and hjkl as "ladder" (which was the presenter's own mnemonic, correctly transcribed). Rather than trusting either the audio or the video's on-screen text, every command in this article was executed against Neovim 0.12.1 in headless sessions launched with -u NONE, and the register and clipboard semantics were read directly from that installation's doc/change.txt and doc/provider.txt. Vim 9.1 was also present on the test machine. Verified 4 August 2026.

💡 Key takeaways

  1. The ordering is the lesson: search → change → repeat → registers → macros. Each section makes the next one useful, which is why this works as a curriculum rather than a list.
  2. * then ciw then n then . is the loop worth building muscle memory for — you review each occurrence instead of trusting a blind global replace.
  3. Operator + text object is the grammar. Learn c, d, y and iw, i", i( separately and you get fifty commands you never memorised.
  4. In :%s/a/b/g, % is which lines and g is how many per line. Different jobs, commonly confused.
  5. Add c to any substitute you run on real code. The video's own demo shows why: it wanted post but not PostsController.
  6. Register "0 is your last yank; "1"9 are your last nine deletes. Not a yank history — proved by running three yanks and finding 1–3 empty.
  7. "0p fixes Vim's most common frustration — yank, delete, paste, and get the wrong thing. Plain p reads the unnamed register, which the delete overwrote.
  8. "_d deletes into the black hole, leaving your yank intact. The other half of the same fix.
  9. Use "+ for the clipboard on every platform. "* is X11's PRIMARY selection, not a macOS thing — and the video's own macOS demo uses "+.
  10. A macro is only as reusable as it is position-independent. End the recording where the next repetition must start.
  11. Macros are text you can edit. :reg h prints yours; :let @h = '...' fixes it without re-recording. And over-count the repeats — a macro stops when a command in it fails.
  12. Learn u before any of this. The video never mentions undo, in ten minutes of destructive commands aimed at beginners.

🔗 Resources & links

🕐 Timestamp index

0:00Thirty commands, easy to intense
0:14nvim <file> and :q
0:44hjkl — "ladder"
1:04* — search the word under the cursor
1:16n and N cycle the matches
1:28ciw — change inner word
1:45. repeats the last change
2:04:%s/old/new/g
2:40The c flag — confirm each replacement
3:04Yank and paste — y, p
3:20viw — visually select, then act
4:54:reg — where the yanked text went
5:43"3p — paste from a numbered register
5:57"7y — yank into a chosen register
6:20Special registers
6:32The * vs + claim
7:04"+y — out of Vim into Slack
7:44"% — the filename register
8:07:let @+ = @%
8:20Macros — the payoff
9:08qh — start recording
9:44@h — replay
9:515@h — replay with a count
☰ View all