Basic Operators·Lesson 13

Intro to Operators

operators

Here'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 word
c $ → change to the end of the line
y t) → copy up to the next )
  • d delete
  • c change (delete, then start inserting)
  • y yank (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.

Try it out

1const total = price * quantity;
2if (total > limit) {
3 notify("over budget", total);
4}
NORMAL1:1
Next: Delete Words