Learn Vim / How to Change Case in Vim (Uppercase / Lowercase)
How to Change Case in Vim (Uppercase / Lowercase)
The answerPress ~ to toggle the case of the character under the cursor. For bigger targets: gUiw uppercases the word, guiw lowercases it.
All the ways
| Keys | What it does |
|---|
| ~ | toggle case of one character |
| gUiw | UPPERCASE the word under the cursor |
| guiw | lowercase the word |
| gUU | UPPERCASE the whole line |
| Vu / VU | lowercase / uppercase the visual selection |
▶ live vim buffertarget 2 keystrokes
“biat” should be “boat”. You're on the wrong letter — press r then o to replace it without entering insert mode.
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “One-letter fix” mission takes about a minute.
Sign in free to practice →
Keep going