vim Manipulating text Converting text case

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

In normal mode:

  • ~ inverts the case of the character under the cursor,
  • gu{motion} lowercases the text covered by {motion},
  • gU{motion} uppercases the text covered by {motion}

Example (^ marks the cursor position):

Lorem ipsum dolor sit amet.
        ^
Lorem ipSum dolor sit amet.    ~
Lorem IPSUM DOLOR sit amet.    gU2w
Lorem IPsum DOLOR sit amet.    gue

In visual mode:

  • ~ inverts the case of the selected text,
  • u lowercases the selected text,
  • U uppercases the selected text

Example (^^^ marks the visual selection):

Lorem ipsum dolor sit amet.
        ^^^^^^^^^^^^^
Lorem ipSUM DOLOR SIT amet.    ~
Lorem ipSUM DOLOR SIT amet.    U
Lorem ipsum dolor sit amet.    u


Got any vim Question?