Make selected block of text uppercase

The question is about how to make CTRL+SHIFT+U work in Visual Studio Code. Here is how to do it in version 1.57.1 or above.

Steps:

  1. Open Visual Studio Code.

  2. Press CTRL+SHIFT+P.

  3. Type

    open keyboard shortcuts
    
  4. Select

    Open keyboard shortcuts (json)

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.


Update August 2021

There is a UI to see and update keyboard shortcuts:

File-> Preferences -> Keyboard Shortcuts.

  1. Find “Transform to Uppercase”:

    enter image description here

  2. Click the + icon.

  3. In the popup, press the desired key combination and hit enter:

    enter image description here

Do the same for lower case.


Note

In the new versions (eg 1.57.x) of VS Code, Ctrl+Shift+L is a shortcut for bulk selecting all selected text occurrences. So you can use another combination, like Ctrl+Shift+/ etc.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)