Basic Operators·Lesson 13
Intro to Operators
operatorsHere's the idea that makes Vim click. An operator says *what* to do and a motion says *how far*:
{operator}{motion}d w → delete a wordc $ → change to the end of the liney t) → copy up to the next )
ddeletecchange (delete, then start inserting)yyank (copy)
Every motion you've learned works with every operator. Learn one new motion and you get three new edits.
Typing an operator twice applies it to the whole line: dd, cc, yy.
Heads up
The rest of the curriculum (operators, search, text objects, visual mode) is part of Pro.
Try it out
1const total = price * quantity;
2if (total > limit) {
3 notify("over budget", total);
4}