Changing case in Vim

前端 未结 2 1101
执念已碎
执念已碎 2021-01-29 17:05

Is there a command in Vim that changes the case of the selected text?

2条回答
  •  野的像风
    2021-01-29 17:50

    Visual select the text, then U for uppercase or u for lowercase. To swap all casing in a visual selection, press ~ (tilde).

    Without using a visual selection, gU will make the characters in motion uppercase, or use gu for lowercase.

    For more of these, see Section 3 in Vim's change.txt help file.

提交回复
热议问题