How to convert all text to lowercase in Vim

ksuralta picture ksuralta · Jul 9, 2009 · Viewed 135.4k times · Source

How do you convert all text in Vim to lowercase? Is it even possible?

Answer

user80168 picture user80168 · Jul 9, 2009

I assume you want lowercase the text. Solution is pretty simple:

ggVGu

Explanation:

  1. gg - goes to first line of text
  2. V - turns on Visual selection, in line mode
  3. G - goes to end of file (at the moment you have whole text selected)
  4. u - lowercase selected area