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.

8/24
Free Trial: 5 lessons remaining
Unlock Full Access

Visual Character Mode Basics

Estimated time: 10 minutes

Task Instructions

Practice visual character and word selections to refactor variable names

Use visual character mode to select and change poorly named variables. Position your cursor at the beginning of 'mr_whiskers_connection', press 'v' to enter visual mode, then use motion commands to select the text you want to change. Press 'c' to change the selected text.

Learning objectives

  • Master visual character mode (v)
  • Practice selecting text with motion commands
  • Learn to change selected text efficiently
  • Understand the difference between visual modes

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.

v
Use visual character mode
c
Change the selected text

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
v Start visual character mode
V Start visual line mode
t{char} Move cursor to before character
f{char} Move cursor to character
c Change selected text

Hints

  • Try using 'vt_' to select from cursor to before the underscore
  • Or use 'viw' to select inner word
  • Visual mode highlights the selected text
vim@sandbox: ~/workspace
Make sure to save your file with :w ⏎ before submitting!