How do I uppercase text inside an HTML tag without changing the tags?
Answer
vitU
Explanation
When editing markup-heavy files, you often need to transform only the tag contents while preserving the surrounding structure. vitU is a compact, high-signal command chain for this: it selects inside the current tag and uppercases the selected text in one flow. This avoids fragile manual selections and keeps your edits structural.
How it works
vstarts Visual modeitexpands the selection to the inner tag text object (content inside the nearest tag pair)Uuppercases the current Visual selection and returns to Normal mode
Because it is structural rather than positional, the command remains reliable even when the text length or indentation changes.
Example
Before (cursor anywhere inside alpha beta):
<p>alpha beta</p>
Run:
vitU
After:
<p>ALPHA BETA</p>
Tips
- Use
vatif you want to include the tag pair itself in the selection - The same pattern works with other Visual operators, such as
vitgUorvit~for different case transforms - If
%jumps are inconsistent in HTML, ensure tag matching support is configured appropriately