WebStorm IDE has a very useful shortcut for selecting text by combination Ctrl + W;
It easy to put cursor for example to one of the arguments in function and press combination twice for select all arguments, first press will select one argument, second - all. And then if you press again, IDE will select all function.
function foo(a, b, c) {}
Summarise, selection increases depending on number of presses shortcut.
VS Code has shortcut Ctrl+D which can select only one argument.
Does anyone know how to add smart selection like in WebStorm to VS Code?
As a comment suggested I tried out https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
However, the only real bind that I wanted was the grow and shrink selection commands. That extension will overwrite a lot of the default VScode keybinds. To get just the grow and shrink selections, edit your keybindings.json
file adding the following lines:
{
"key": "ctrl+w",
"command": "editor.action.smartSelect.grow",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+w",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
}
*edit: Using version 1.26.1
This is possible without an extension with the command "Expand select", editor.action.smartSelect.grow
, which by default is "ctrl+shift+cmd+right"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With