Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ cat keys
1 auto
2 break
3 case
4 char
5 const
6 continue
$

Using vim, what is the quickest way to toggle the case of all the text to get this?

1 AUTO
2 BREAK
3 CASE
4 CHAR
5 CONST
6 CONTINUE
share|improve this question
up vote 4 down vote accepted

I'm not sure it's the quickest, but what I would do is type this:

gggUG

See

:help gU
share|improve this answer

You could also do:

SHIFT + V
SHIFT + G
SHIFT + ~

Note: Text will be converted to UPPER case if all chars are in lower case.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .