Course
Free Trial: 5 lessons remaining
Unlock Full Access
Practice
Beginner
10 min
Visual Mode Best Practices
Visual Mode: The Art of Selection
Task Instructions
Master efficient visual mode workflows and common patterns
Practice common visual mode patterns and learn when visual mode is the best tool versus using normal mode operations. This lesson focuses on practical patterns used by Vim professionals.
Learning objectives
- Master efficient visual mode workflows
- Learn when to use visual mode vs normal mode operations
- Practice common visual mode patterns
- Understand visual mode best practices
Required keystrokes
Your submission is checked for these keystrokes, not just the final text — so reach for the technique, not a workaround.
- [vV] Use visual mode
- gv Re-select last selection
Helpful commands
- V
- Visual line mode
- v
- Visual character mode
- Ctrl+v
- Visual block mode
- gv
- Re-select last visual selection
- >
- Indent selected text
- o
- Switch cursor to other end of selection
Stuck? Peek at a hint 3 hints · try it on your own first
- Visual mode is great for complex selections, but normal mode operations can be faster for simple edits
- Use gv to re-select your last visual selection
- Combine visual mode with operators like d, c, >, <, gU, gu
# Visual Mode Best Practices
# Practice efficient visual mode patterns
class UserManager {
constructor() {
this.users = [];
this.activeUsers = [];
this.bannedUsers = [];
}
// These methods need to be reordered alphabetically
removeUser(id) {
// Remove user logic
}
addUser(user) {
// Add user logic
}
updateUser(id, data) {
// Update user logic
}
banUser(id) {
// Ban user logic
}
getUser(id) {
// Get user logic
}
}
# TODO: Practice these visual mode patterns:
# 1. Use V to select entire methods and reorder them alphabetically
# 2. Use Ctrl+v to add '//' comment markers to multiple lines
# 3. Use v to select and change variable names
# 4. Practice using gv to re-select your last selection
# 5. Use visual mode with > to indent blocks