Course
Free Trial: 5 lessons remaining
Unlock Full Access
Practice
Beginner
10 min
Visual Mode with Different Operators
Visual Mode: The Art of Selection
Task Instructions
Learn to combine visual selections with various operators like d, y, c, >
Practice combining visual selections with different operators like gu (lowercase), gU (uppercase), > (indent), and others to transform selected text efficiently.
Learning objectives
- Learn to combine visual selections with various operators
- Master using d, y, c, >, gu, gU with visual mode
- Understand how operators work with different visual modes
- Practice efficient text transformation workflows
Required keystrokes
Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.
- v Use visual character mode
- V Use visual line mode
- gu Make selection lowercase
- > Indent selection
Helpful commands
- v{motion}{operator}
- Apply operator to selection
- gu
- Make lowercase
- gU
- Make uppercase
- >
- Indent right
- <
- Indent left
Stuck? Peek at a hint 1 hint · try it on your own first
- After selecting text with v/V/Ctrl-v, you can apply operators: d (delete), y (yank), c (change), gu (lowercase), gU (uppercase), > (indent)
# Visual Mode with Operators Practice
# Use visual mode with different operators to transform this code
class UserManager:
def __init__(self):
self.USERS = [] # This should be lowercase
self.CONFIG = {} # This should be lowercase
def ADD_USER(self, user): # Function names should be lowercase
self.USERS.append(user)
def REMOVE_USER(self, user_id): # Function names should be lowercase
self.USERS = [u for u in self.USERS if u.id != user_id]
def GET_CONFIG_VALUE(self, key): # Function names should be lowercase
return self.CONFIG.get(key)
# TODO: Use visual mode with operators:
# 1. Select 'USERS' and use 'gu' to make it lowercase
# 2. Select 'CONFIG' and use 'gu' to make it lowercase
# 3. Select the ADD_USER function name and use 'gu' (or 'c' and retype)
# 4. Use visual line mode (V) on the entire ADD_USER method and indent with '>'
# 5. Select text inside quotes and change it