Mission 46 / 52• Text Objects - Mega Review

Text Objects Mega Review

Congratulations on reaching the text objects milestone! You now command Vim's most potent editing primitives.

Let's review the complete grammar: `[operator: d, c, y] + [target: i, a] + [object: {, (, ", w, p]`.

Mega Review Cheat Sheet

  • ci{ / di{change / delete inside curly braces
  • ci" / di"change / delete inside quotation marks
  • ciw / dawchange / delete words and spacing
  • cip / dapchange / delete code blocks and paragraphs
1
function authenticateUser(token, options = {}) {
2
const secret = "default-secret-key";
3
const isValid = verifyToken(token, secret);
4
return isValid;
5
}

Use `ci"` on `secret` to update the key. Use `ci(` on `options` to change parameters. Use `ciw` to rename `isValid`.

Now it's your turn!

  1. Navigate to each green target across the code snippet.
  2. Use the motions and techniques learned in this lesson to land accurately on each target.
  3. See how fast you can complete 10 targets.
0/10
1
function authenticateUser(token, options = {}) {
2
const secret = "default-secret-key";
3
const isValid = verifyToken(token, secret);
4
return isValid;
5
}
NORMAL
00:00