Vim: Switching All Text to lower case

One of the beauty of Vi (and Vim) is that with a few key combinations, you can control editing the entire text, a few words/lines, or few letters.

Disclaimer:
The information below is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others.

Here is the key combination to switch all text to lower case: ggVGu

gg - Move to the beginning of the file.
V - Visual mode.
G - Select all text.
u - Switch to lower case.

Here is with search and replace function for entire file: :%s/[A-Z]/\L&/g

Lastly, doing so for single letter: ~

That's a tilde or squiggly.

That's all!
-gibb

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>