如何在Visual Studio代码中切换高亮文本的情况?VS允许通过CTRL+SHIFT+U和CTRL+U。
是否有我可以设置的命令绑定来执行此操作,或者它是默认的一些其他组合键?
如何在Visual Studio代码中切换高亮文本的情况?VS允许通过CTRL+SHIFT+U和CTRL+U。
是否有我可以设置的命令绑定来执行此操作,或者它是默认的一些其他组合键?
当前回答
在Visual Studio Code中,你可以在Sublime Text (CTRL+K CTRL+U和CTRL+K CTRL+L)中做这些事情:
打开“键盘快捷键”,点击“文件->首选项->键盘快捷键” 点击“keybindings”。出现在“搜索键绑定”字段下的链接 在[]括号之间添加: { 键:“ctrl+k ctrl+u”, “命令”:“editor.action.transformToUppercase”, “当”:“editorTextFocus” }, { 键:“ctrl+k ctrl+l”, “命令”:“editor.action.transformToLowercase”, “当”:“editorTextFocus” } 保存并关闭"keybindings.json"
另一种方法: 微软发布了“Sublime Text Keymap and Settings Importer”,这是一个从Sublime Text导入按键绑定和设置到VS Code的扩展。 ——https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings
其他回答
以下是justanotherdev的评论:
令人兴奋和有用的:
命令面板:CTRL + SHIFT + p (Mac: CMD + SHIFT + p) 输入>transform pick大写/小写并按enter
在Visual Studio Code中,你可以在Sublime Text (CTRL+K CTRL+U和CTRL+K CTRL+L)中做这些事情:
打开“键盘快捷键”,点击“文件->首选项->键盘快捷键” 点击“keybindings”。出现在“搜索键绑定”字段下的链接 在[]括号之间添加: { 键:“ctrl+k ctrl+u”, “命令”:“editor.action.transformToUppercase”, “当”:“editorTextFocus” }, { 键:“ctrl+k ctrl+l”, “命令”:“editor.action.transformToLowercase”, “当”:“editorTextFocus” } 保存并关闭"keybindings.json"
另一种方法: 微软发布了“Sublime Text Keymap and Settings Importer”,这是一个从Sublime Text导入按键绑定和设置到VS Code的扩展。 ——https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings
我写了一个Visual Studio Code扩展来更改大小写(不仅仅是大写,还有许多其他选项):https://github.com/wmaurer/vscode-change-case
要将大写命令映射到按键绑定(例如Ctrl+T U),单击File -> Preferences -> Keyboard shortcuts,并将以下内容插入到json配置中:
{
"key": "ctrl+t u",
"command": "extension.changeCase.upper",
"when": "editorTextFocus"
}
编辑:
随着2016年11月VSCode的更新(发布说明),内置了通过命令editor.action.transformToUppercase和editor.action.transformToLowercase转换为大写和小写的支持。这些没有默认的键绑定。
更改大小写扩展对于其他文本转换仍然有用,例如camelCase, PascalCase, snake-case等。
我认为这是目前缺少的功能。
我注意到,当我做一个指南,键盘快捷键之间的区别,它和Sublime。
虽然这是一个新的编辑器,但如果他们在新版本中添加它,我不会感到惊讶。
来源:https://code.visualstudio.com/Docs/customization
摘自这篇文章:
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.