Leave and return deliberately

0 of 1

The technique

Your textVim mode: Normal
Visit the end of the file, then come back. Before: top note / middle / end. After: top note / middle / end.

G is a jump, so Vim remembers where you were. Ctrl-o returns there, to the same column.

Keys in this lesson

Ctrl-o
Back to where you were before a jump.
Ctrl-i
Forward again.
ma
Set mark a here.
`a
Return to mark a, to the exact column.

Before this lesson: Buffer destinations.

More about this lesson

Go somewhere else in the file and come back, using the jump list or a mark.

Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.

Example

From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.

Use Start over to try again.

Guides on this topic

Exercise 1 of 1

0keys

par 9

The drawer should show the same note as checkout. Copy checkout's translation key into the empty t("").

Your textVim mode: Normal

Make it look like this

// Notes in the cart drawer and at checkout. The texts come from the translations.
import { t } from "../i18n";
import { Note } from "../ui/Note";

export function DrawerNotes() {
  return <div className="drawer-notes"><Note tone="info" text={t("checkout.free_shipping_over_50")} /></div>;
}

export function CheckoutNotes({ order }) {
  const title = t("checkout.notes_title");
  const tone = order.placedAt.getMonth() === 11 ? "warning" : "info";
  return <Note tone={tone} title={title} text={t("checkout.free_shipping_over_50")} />;
}

export default DrawerNotes;

Yours

Par

Keyboard shortcuts
Ctrl+Enter
Check the result
Ctrl+Alt+U
Undo the last change
Ctrl+Alt+H
Show the next hint
Ctrl+Alt+R
Start the exercise over
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Ctrl+Alt+K⌃⌥K
Show the keyboard shortcuts
Ctrl+Alt+F⌃⌥F
Turn focus mode on or off
Ctrl+Alt+S⌃⌥S
Open the editor settings
Enter
Go on to the next step after you finish

The Ctrl+Alt shortcuts don't clash with Vim's own keys. On a Mac, use Control and Option.