textfull-text-searchtext-editorvim

How to change the first two uppercase characters on each line to lowercase in Vim?


I have the following text:

HELLO TO STACKOVERFLOW
WELCOME TO STACKOVERFLOW

I want the text to be changed as follows:

heLLO TO STACKOVERFLOW
weLCOME TO STACKOVERFLOW

How can I do that in Vim?


Solution

  • Highlight a visual block for the first two colums with CTRL-V

    enter image description here

    Enter gu or u to downcase the selected text, gU or U to upcase.

    enter image description here