Vim Recall繁體中文

Toggle case in a paragraph

g~ap

Example

Normal 0 / 2
One TWO
Three

KEEP
Cursor on line 1, column 2

Toggle case in a paragraph.

Before & after
Before
One TWO
Three

KEEP
Cursor on line 1, column 2
After
oNE two
tHREE

KEEP
Cursor on line 1, column 1

Start in Normal mode, at line 1, column 2 (one-based). A two-character operator followed by a text object applies the transformation to that object. Press g~ap.

Details & Vim help

Example replayed in Vim

A two-character operator followed by a text object applies the transformation to that object.