SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog



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 »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

I was here...