VS Code在"插入符号"中选择单词,如WebStorm IDE中那样

ros*_*eri 2 intellij-idea webstorm visual-studio-code vscode-settings

WebStorm IDE有一个非常有用的快捷方式,可以通过组合Ctrl + W来选择文本;

很容易将光标放在函数中的一个参数中并按两次组合以选择所有参数,首先按将选择一个参数,第二个 - 全部.然后,如果再次按下,IDE将选择所有功能.

function foo(a, b, c) {}
Run Code Online (Sandbox Code Playgroud)
  • 首先按:选中b(例如)
  • 第二:选择a,b,c
  • 第三:选择函数foo(a,b,c){}

总结,选择根据按下快捷方式的数量而增加.

VS Code 快捷键Ctrl + D,只能选择一个参数.

有谁知道如何在WebStorm中添加智能选择到VS代码?

小智 13

作为评论建议我尝试了https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings

然而,我想要的唯一真正绑定是增长和收缩选择命令。该扩展将覆盖许多默认的 VScode 键绑定。要获得增长和缩小选择,请编辑您的keybindings.json文件,添加以下行:

{
  "key": "ctrl+w",                
  "command": "editor.action.smartSelect.grow",
  "when": "editorTextFocus" 
},
{
  "key": "ctrl+shift+w",
  "command": "editor.action.smartSelect.shrink",
  "when": "editorTextFocus"
}
Run Code Online (Sandbox Code Playgroud)

*编辑:使用版本 1.26.1


Rob*_*ens 6

没有使用"Expand select"命令的扩展名,这是可能的editor.action.smartSelect.grow,默认情况下是"ctrl+shift+cmd+right"