Is there a way to change case to low or high integer blocks in vim visual mode?

Want to change case to omit the entire block in visual mode. If I want to change the case of a single character, I can press ~, but what do I need to use in visual mode to change the selected area to low or high case?

+7
source share
3 answers
  • ~ also works on visual blocks and β€œinverts” the case (lowercase letters in upper case, upper case becomes lowercase)
  • u makes lowercase choices (regardless of source case)
  • u makes uppercase selection (regardless of the source case)
+13
source

The ~ command also works on a visually selected block.

For example, if you:

  • Press v to enter visual mode.
  • Select the text area to change.
  • Click ~

It changes the case of all selected text.

+4
source

With active visual selection, press "u" for lowercase, "U" for uppercase.

Without visual mode, use 'gu' or 'gU', with a move command. For example. for the uppercase word "gUw".

+3
source

All Articles