如何在Visual Studio代码中切换高亮文本的情况?VS允许通过CTRL+SHIFT+U和CTRL+U。

是否有我可以设置的命令绑定来执行此操作,或者它是默认的一些其他组合键?


当前回答

摘自这篇文章:

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). You can also choose a different key combination. 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.

其他回答

摘自这篇文章:

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). You can also choose a different key combination. 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.

我认为这是目前缺少的功能。

我注意到,当我做一个指南,键盘快捷键之间的区别,它和Sublime。

虽然这是一个新的编辑器,但如果他们在新版本中添加它,我不会感到惊讶。

来源:https://code.visualstudio.com/Docs/customization

使用快捷键“Ctrl + Shift + P”打开命令面板提示符。

在命令中,调色板开始输入您希望转换的文本大小写,例如小写或大写,然后选择相应的选项,如下图所示。

对于那些害怕在vscode json设置中搞砸任何事情的人来说,这是很容易遵循的。

Open "File -> Preferences -> Keyboard Shortcuts" or "Code -> Preferences -> Keyboard Shortcuts" for Mac Users In the search bar type transform. By default you will not have anything under Keybinding. Now double-click on Transform to Lowercase or Transform to Uppercase. Press your desired combination of keys to set your keybinding. In this case if copying off of Sublime i will press ctrl+shift+u for uppercase or ctrl+shift+l for lowercase. Press Enter on your keyboard to save and exit. Do same for the other option. Enjoy KEYBINDING

以下是justanotherdev的评论:

令人兴奋和有用的:

命令面板:CTRL + SHIFT + p (Mac: CMD + SHIFT + p) 输入>transform pick大写/小写并按enter