Make selected block of text uppercase

前端 未结 13 1803
旧巷少年郎
旧巷少年郎 2020-12-12 09:50

Can I make a multi-line selection of text all capitals in Visual Studio Code?

In full Visual Studio it\'s CTRL+SHIFT+U

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 10:04

    Creator of the change-case extension here. I've updated the extension to support spanning lines.

    To map the upper case command to a keybinding (e.g. CTRL+T+U), click File -> Preferences -> Keyboard shortcuts, and insert the following into the json config:

    {
      "key": "ctrl+t ctrl+u",
      "command": "extension.changeCase.upper",
      "when": "editorTextFocus"
    }
    

    EDIT:

    With the November 2016 (release notes) update of VSCode, there is built-in support for converting to upper case and lower case via the commands editor.action.transformToUppercase and editor.action.transformToLowercase. These don't have default keybindings. They also work with multi-line blocks.

    The change-case extension is still useful for other text transformations, e.g. camelCase, PascalCase, snake_case, kebab-case, etc.

提交回复
热议问题