Capitalize first letter of each word in a selection using vim

前端 未结 6 2439
抹茶落季
抹茶落季 2020-12-12 13:13

In vim, I know we can use ~ to capitalize a single char (as mentioned in this question), but is there a way to capitalize the first letter of each word in a sel

6条回答
  •  半阙折子戏
    2020-12-12 13:38

    The Vim Tips Wiki has a TwiddleCase mapping that toggles the visual selection to lower case, UPPER CASE, and Title Case.

    If you add the TwiddleCase function to your .vimrc, then you just visually select the desired text and press the tilde character ~ to cycle through each case.

提交回复
热议问题