Toggle case in a paragraph
g~ap
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2One TWO
Three
KEEPCursor on line 1, column 2One TWO
Three
KEEPCursor on line 1, column 2oNE two
tHREE
KEEPCursor on line 1, column 1Toggle case in a paragraph.
Waiting for motion or text object
Toggle case in a paragraph
Before & after
One TWO
Three
KEEPCursor on line 1, column 2oNE two
tHREE
KEEPCursor on line 1, column 1Start 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.