Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
$ 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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.