Previous TipNext Tip

Tip: #49 - Switching case of characters

Created: March 14, 2001 9:24 Complexity: basic Author: Anonymous Version: 5.7 Karma: 102/51 Imported from: Tip#49

To switch the case of one or more characters use the "~", "gU" or

"gu" commands.


~ - switch case of character under cursor

(in visual-mode: switch case of highlighted text) 

3~ - switch case of next three characters

g~~ - switch case of current line

U - in visual-mode: make highlighted text uppercase

gUU - make current line uppercase

u - in visual-mode: make highlighted text lowercase

guu - make current line lowercase

gUaw - make current word uppercase

guaw - make current word lowercase

For some more examples refer to

:help ~

See also:

help simple-change


Not exactly case related but something I really like.

g? does rot13 "encryption" , May 7, 2002 6:40

Instead of g~~, i prefer V~

uws--AT--xs4all.invalid , July 8, 2003 4:25

Community content is available under CC-BY-SA unless otherwise noted.