Tip: vi and lowercase/uppercase


As always I use my blog as reminder of some useful commands or tips.

This one is for dimi, to change the case of a full document in vi, use the following command to transform everything in lowercase :


and in uppercase :


I hope this helps 😉

13 thoughts on “Tip: vi and lowercase/uppercase

  1. 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

    1. so just wanted to break down that last post so people know what’s up with it.

      the first 2 ‘g’s put your cursor to the beginning of the file. the 3rd g puts you in what appears to be a “replace” mode of some kind. U means uppercase (or u means lowercase) the final G means until the end of the file.

      So if you want to manipulate just a single word you should move the cursor to the beginning of the word then type gUw ((g)replace to (U)uppercase until (w)the end of the word).

      Or if you want to go from the current position to the end of the line gU$ ((g)replace to (U)uppercase until ($)the end of the line).

      Or if you want to go from the current position to the next ‘x’ on the line gUtx ((g) replace to (U) uppercase (t) to (x) the x character)… Of course you can replace x with any character you want.

      Figured that might help those who don’t know about jumping around in a file.

      (also if you only want to do the current line and the next two lines: gU2).

      This stuff is handy!

          1. To my understanding, “apply to the Whole file” is done by the last ‘G’ not the 3rd ‘g’.
            the ‘G’ means “till the end of the document”.

            The 3rd ‘g’ would mean “apply to all characters” and may be replace by a regexp, no?

  2. I need a driver for my phillips snn6500 wireless netcard
    or smc2632 wireless net card.
    I can`t make them run on linpus linux lite.

    Please help.


  3. I had a similar problem: had a list of words, one in each line, and wanted to append a ‘;’ followed by the word in lowercase. Thanks for this page, it helped me find the solution:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Last Tweets

  • RT : 昨年開催されたOracle MySQL Innovation Day 2018 秋の模様がEnterpriseZineのDB Onlineに掲載されました / MySQL 8.0の新機能から寿司ビール問題まで――Oracle MySQL Innovation Day 2018 秋 via ,
  • If you have a ticket for the pre-FOSDEM Day and you are not able to join, please release your ticket, there are people on the waiting list ! Thank you in advance ! ,
  • When your laptop dies just before 2 weeks of conferences... ,
  • RT : EVENTS:  MySQL Day, Denver, CO Forget Skiing. On Tuesday, January 29, 2019 Denver is all about NoSQL + SQL = MySQL. Join us to learn about NoSQL+SQL, plus how to improve your database performance, secure your data and prevent downtime. Register today! ,
  • RT : MySQL is ubiquitious for cloud usage. In this series I will explore Oracle Cloud's IaaS offerings that support MySQL. In this particular post I will highlight IaaS Enterprise capabilities that help secure our cloud perimiter. ,
Locations of visitors to this page