Visual Studio Code - Make the selected block of text uppercase?

Can I make multi-line text selection for all capitals in Visual Studio code? In the full version of Visual Studio, this is CTRL + SHIFT + U for this.

The extension that exists, which I saw, only executes multi-line blocks.

+184
visual-studio-code
03 Feb '16 at 18:10
source share
9 answers

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

File-> Settings β†’ Hotkeys.

An editor will appear with the keybindings.json file. Put the next JSON 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 use the selected text, even if multi-line. Similarly, CTRL + SHIFT + L will make the selected text lowercase.

These commands are built into the VS code, and they do not require extensions to work.

+322
Jan 17 '17 at 3:18
source share

The creator of the change case extension is here. I updated the extension to support tie lines.

To map an uppercase command to a key binding (e.g. CTRL + T + U ), click File β†’ Options β†’ Keyboard Shortcuts and paste the following into your json configuration:

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

EDIT:

The November 2016 VSCode update (release notes) introduced native support for converting to uppercase and lowercase using the editor.action.transformToUppercase and editor.action.transformToLowercase . They do not have default key bindings. They also work with multi-line blocks.

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

+57
Feb 13 '16 at 21:51
source share

Highlight the text you want in uppercase. Then press CTRL + SHIFT + P to bring up the command palette. Then start typing the word "Uppercase" (case sensitive) and you will see the Transform to Uppercase . Click on it and it will make your text capitalized.

Whenever you want to do something in VS Code and don’t know how, it would be nice to call up the command palette using CTRL + SHIFT + P and try entering the desired keyword. Often a team appears there, so you do not need to search the net for how to do something.

+54
May 18 '17 at 21:04
source share

March 8, 2018 Patch with Visual Studio Code 1.20.1 (mac)

This has been greatly simplified recently.
Very simple and right now.

  1. From "Code" β†’ "Settings" β†’ "Keyboard Shortcuts"
  2. From the search box, simply search for "editor.action.transformTo". You will see a screen similar to the following: screenshot of keyboard shortcuts setup dialog in Visual Studio Code (mac)

  3. Click on the plus sign to the left of each item, a dialog box will appear in which you can [press] the necessary key combinations, after this is displayed on the screen, just press [Enter] to save.

+10
Mar 08 '18 at 1:28
source share

I use the extension for change and it works great. I defined shortcuts:

 { "key": "ctrl+shift+u", "command": "extension.changeCase.upper", "when": "editorTextFocus" }, { "key": "ctrl+u", "command": "extension.changeCase.lower", "when": "editorTextFocus" }, 
+5
Aug 08 '16 at 7:53 on
source share

Change case of letters in Visual Studio code

Uppercase: Ctrl + K , Ctrl + U

and lowercase: Ctrl + K , Ctrl + L.

Mnemonic

K , for example, K.

U like U pper case

L like L ower case

+3
Aug 04 '17 at 12:33 on
source share

There are no default shortcuts on Linux, so try setting your own shortcut and be careful not to select hotkeys (for example, CTRL + U is taken as a comment)

  1. File-> Preferences β†’ Keyboard Shortcuts.
  2. Type "transfrom" in the search bar to find conversion shortcuts.
  3. Edit the keyboard shortcut.

In my case, I have CTRL + U CTRL + U to convert to uppercase and CTRL + L CTRL + L to convert to lowercase

enter image description here

+3
Jun 10 '18 at 18:33
source share

September 19, 2018 , these lines helped me:

File-> Preferences β†’ Keyboard Shortcuts.

An editor will appear with the keybindings.json file. Put the next JSON there and save.

 // Place your key bindings in this file to overwrite the defaults [ { "key": "ctrl+shift+u", "command": "editor.action.transformToUppercase", "when": "editorTextFocus" }, { "key": "ctrl+shift+l", "command": "editor.action.transformToLowercase", "when": "editorTextFocus" }, ] 
+2
Sep 19 '18 at 23:01
source share

Standard binding for VS code on macOS:

Select upper case ⌘ + K , ⌘ + U and lower case: ⌘ + K , ⌘ + L.

All key combinations can be opened with + K ⌘ + S (for example, K eyboard S ), where you can also search for specific key combinations.

+1
Aug 29 '17 at 6:23
source share



All Articles