SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog

Archives Posts

How To Switch to Lower or Upper Case in Vi or Vim

January 23rd, 2014 by elizar

for uppercase: gggUG
for lowercase: ggguG

PS: the first 2 g’s are for moving to the beginning of the document.
PS2: works in vim, don’t know about plain vi

Can also do this using the search function in command mode

<esc> :%s/.*/\L&/

and in uppercase :

<esc> :%s/.*/\U&/

Filed under Commands having No Comments »

I was here...