Want to change case to lower in whole block in visual mode. If i want to change case of a single character, i can press ~, but what i need to use in visual mode for changing in selecte开发者_JS百科d area into low or high case ?
- The
~
also works on visual blocks and 'inverts' the casing (lowercase becomes uppercase, uppercase becomes lowercase) u
makes the selection lower case (regardless on the original casing)U
makes the selection upper case (regardless on the original casing)
The ~
command works on a visually selected block as well.
For example, if you:
- Press
v
to enter visual mode - Highlight the area of text to modify
- Press
~
It changes the case of all the highlighted text.
With visual selection active, press 'u' for lowercase, 'U' for uppercase.
Without visual mode, use 'gu' or 'gU', with motion command. E.g. to uppercase a word 'gUw'.
精彩评论