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

KeysWhat it does
~toggle case of one character
gUiwUPPERCASE the word under the cursor
guiwlowercase the word
gUUUPPERCASE the whole line
Vu / VUlowercase / uppercase the visual selection

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.

Practice free — no signup →

Keep going