Make selected block of text uppercase

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

    Change letter case in Visual Studio Code

    To upper case: Ctrl+K, Ctrl+U

    and to lower case: Ctrl+K, Ctrl+L.

    Mnemonics:

    K like the Keyboard

    U like the Upper case

    L like the Lower case

    0 讨论(0)
  • 2020-12-12 10:14

    I think you can use Step 1: Select text Step 2: Ctrl + Shift + P Step 3: Enter Uppercae

    0 讨论(0)
  • 2020-12-12 10:16

    Without defining keyboard shortcuts

    1. Select the text you want capitalized

    2. Open View->Command Palette (or Shift+Command+P)

    3. Start typing "Transform to uppercase" and select that option

    4. Voila!

    0 讨论(0)
  • 2020-12-12 10:20

    It is the same as in eclipse:

    • Select text for upper case and Ctrl + Shift + X
    • Select text for lower case and Ctrl + Shift + Y
    0 讨论(0)
  • 2020-12-12 10:22

    In Linux and Mac there are not default shortcuts, so try to set your custom shortcut and be careful about don't choose a hotkey used (For example, CTRL+U is taken for uncomment)

    1. File-> Preferences -> Keyboard Shortcuts.
    2. Type 'transfrom' in the search input to find transform shortcuts.
    3. Edit your key combination.

    In my case I have CTRL+U CTRL+U for transform to uppercase and CTRL+L CTRL+L for transform to lowercase

    Just in case, for Mac instead of CTRL I used

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题