Make selected block of text uppercase

前端 未结 13 1780
旧巷少年郎
旧巷少年郎 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:28

    The question is about how to make CTRL+SHIFT+U work in Visual Studio Code. Here is how to do it. (Version 1.8.1 or above).

    File-> Preferences -> Keyboard Shortcuts.

    An editor will appear with keybindings.json file. Place the following JSON in there and save.

    [
     {
        "key": "ctrl+shift+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
     },
     {
        "key": "ctrl+shift+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
     }
    ]
    

    Now CTRL+SHIFT+U will capitalise selected text, even if multi line. In the same way, CTRL+SHIFT+L will make selected text lowercase.

    These commands are built into VS Code, and no extensions are required to make them work.

提交回复
热议问题