Keep the quotation
The technique
Spaces inside the quotes belong to the text, so the whole message changes.
Keys in this lesson
- ci"
- Change the text inside double quotes.
- di"
- Empty the quotes.
Before you begin
Use h, j, k, l to move in Normal mode. Esc stops inserting and u undoes an edit. 0 goes to the start of the line and 2G goes to line 2. A count repeats a movement, so 3l moves three characters right.
More about this lesson
Change what's inside the quotation marks and keep the marks themselves.
You'll need the lesson on changing and deleting a word first. i" means everything inside the double quotes, including spaces and punctuation.
const state = "not ready";
From inside “not ready”, ci", then ready now, then Esc replaces the whole message. di" empties it. Both keep the quotes. a" takes the quotation marks too, which is a different edit.
From before the first string on a line, ci" finds that string ahead of your cursor. When a line has two strings, move inside the one you mean first.
These exercises use plain double-quoted text on one line. Escaped quotes, strings over several lines and nested brackets aren't covered here.
Guides on this topic
Exercise 1 of 3
0keys
par 15The page has no heading yet. Make it Your orders.