$ 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
link|improve this question

feedback

2 Answers

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
link|improve this answer
feedback

You could also do:

SHIFT + V
SHIFT + G
SHIFT + ~

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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