Change Word

In this lesson, you'll learn how to use the change operator with word motion.

Changing words is an extremely common task in programming. The change operator deletes the text and immediately puts you in insert mode, making it perfect for replacing words quickly.

c
w
-change a word
Example
escape
-cancel the in progress operator
Example

Now it's your turn!

  1. Use the change operator to change words highlighted in red.
  2. Remember to use cw to change a word from the cursor position to the end of the word.
  3. If you begin the change operator in the wrong location, press ESC to cancel the operator.







function greet(name) {
return `Hello, ${name}!`;
}
const message = greet("world");
greet();
 0/15  00:00

Note: The change operator (c) deletes the text and immediately puts you in insert mode. After typing your replacement, press ESC to return to normal mode.