Tag: keyboard shortcuts

VSCode — Shortcut for Uppercase and Lowercase Conversion

While you can run a command to convert the selected text to upper (or lower) case, there doesn’t appear to be a quick way to do it. Luckily, you can define your own keyboard shortcuts and map those shortcuts to commands. From the File menu, select “Preferences” and “Keyboard Shortcuts” (or use the Ctrl-K Ctrl-S combo).

In the upper right-hand corner, click this icon to open the custom keyboard shortcut JSON file

Add JSON elements for the shortcuts you want to define — the key combination, the command to run, and on what to run the command

Sample key command bindings:

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

Save … voila, a keyboard shortcut to change to upper and lower case.