vimtricks.wiki Concise Vim tricks, one at a time.

How do I convert selected text to uppercase?

Answer

U (in visual mode)

Explanation

In visual mode, pressing U converts all selected text to uppercase. This is a quick way to change the case of a selection.

How it works

  • Select text with v, V, or <C-v>
  • Press U to convert to uppercase
  • The selection is deselected after the conversion

Example

hello world

Select hello world with V, press U:

HELLO WORLD

Tips

  • u in visual mode converts to lowercase
  • ~ in visual mode toggles the case
  • gU{motion} uppercases without visual mode (e.g., gUiw)
  • gu{motion} lowercases without visual mode
  • Works with all visual mode types including block mode

Next

How do you yank a single word into a named register?