Jumping to matching characters
Certain characters come in opening and closing pairs. For example (), {}, and [].
Sometimes, you’ll want to jump from the opening character to the closing character, or vice-versa. Vim has a command for that: % in normal mode.
There’s some matching bracket pairs set up for you in the editor. Work through the checklist below to put % through its paces.
1 2 3 4
Jump to the matching bracket The cursor starts on the opening ( — to land on its partner, press %.
Jump back again To bounce back to the opening (, press % a second time.
Match the curly braces Put the cursor on the { a few lines down, then press %.
Untangle the mess Find the partner of the very first ( in the pile — 16G puts you on it, then press %.
Next: Jump back again
Next: Match the curly braces
Next: Untangle the mess
Last one — goal check runs when it's done
Nice work!
Up next: Lesson 4 — Basic Editing.