Vim Recall繁體中文

Toggle case inside a word

g~iw

Example

Normal 0 / 2
oNe Two
Cursor on line 1, column 2

Toggle case inside a word.

Before & after
Before
oNe Two
Cursor on line 1, column 2
After
OnE Two
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~iw.

Details & Vim help

Example replayed in Vim

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