Screen Too Small

This course material requires a larger screen to properly display the terminal and editor interfaces.

Please use a tablet, laptop, or desktop computer for the best learning experience.

You can continue browsing, but the experience will be significantly limited.

Advanced Insert Mode Entry

Estimated time: 10 minutes

Task Instructions

Master all the ways to enter insert mode for different situations

Fix the Java class using different insert mode entries. Use 'A' to add semicolons at line ends, 'a' to add braces after methods, 'o' for closing braces on new lines, 'O' for annotations above, and 'i' for inline edits.

Learning objectives

  • Master all insert mode entry methods
  • Understand when to use each method
  • Develop efficient editing patterns

Required Keystrokes

This lesson requires you to use specific keystrokes to complete it. Your submission will be evaluated based on whether you used the required keystrokes mentioned below, rather than matching a specific output.

i
Use insert mode
a
Use append mode
A
Use append at end of line

What This Means

  • Your solution must include the required keystroke patterns
  • The order of keystrokes may matter depending on the exercise
  • You'll still need to achieve the expected output
  • This helps you practice specific Vim techniques

Helpful commands:

Command Description
i Insert at cursor
a Append after cursor
I Insert at beginning of line
A Append at end of line
o Open new line below
O Open new line above

Hints

  • I = insert at beginning of line, A = append at end of line
  • o = new line below, O = new line above
  • Choose the right entry point to minimize keystrokes

Ready for Vim?

Before starting this lesson, be prepared.

Read the directions on the left, and when you're ready, let's go!