How do you convert all text in Vim to lowercase? Is it even possible?
Similar to mangledorf's solution, but shorter and layman friendly
:%s/.*/\L&/g
If you are running under a flavor of Unix
:0,$!tr "[A-Z]" "[a-z]"
Many ways to skin a cat... here's the way I just posted about:
:%s/[A-Z]/\L&/g
Likewise for upper case:
:%s/[a-z]/\U&/g
I prefer this way because I am using this construct (:%s/[pattern]/replace/g
) all the time so it's more natural.
I had a similar issue, and I wanted to use ":%s/old/new/g"
, but ended up using two commands:
:0
gu:$