How do I uppercase only the text inside braces using a visual text object?
Answer
f{vi{U
Explanation
When editing structured text, you often need to transform content inside delimiters without touching the delimiters themselves. f{vi{U is a compact pattern that jumps to a brace, selects only the inner block, and applies uppercase to that region.
How it works
f{moves the cursor forward to the next{on the linevi{enters visual mode and selects the text inside curly bracesUuppercases the active visual selection
This is faster and safer than trying to motion-select by character count. Because it uses a text object, it adapts to different content lengths automatically and keeps the braces unchanged.
Example
Before:
config = {alpha beta};
Run:
f{vi{U
After:
config = {ALPHA BETA};
Tips
- The same approach works with other delimiters, including parentheses and brackets
- Replace
Uwith other visual operators to reuse the same selection shape for different edits