user1675891
user1675891

Reputation:

Shortcut key for selecting a word and extending the selection in VS Code

In VS with Resharper, there's the command ctrlw that will select the whole word at cursor and then, when pressed repeatedly, extend the selection to the brackets, then include them too, then to the next outer brackets etc.

What is the name of the command for that in Visual Studio Code?

Upvotes: 61

Views: 25925

Answers (3)

Beatle Refractor
Beatle Refractor

Reputation: 649

Mac

  • Shirnk: Cntrl^ + Shift + Left

  • Expand: Cntrl + Shift + Right

Upvotes: 3

Bill_Stewart
Bill_Stewart

Reputation: 24555

The shrink/expand selection commands should be what you are looking for. The command names are editor.action.smartSelect.grow (default keybinding shift+alt+right) and editor.action.smartSelect.shrink (default keybinding shift+alt+left).

Upvotes: 87

65536 M
65536 M

Reputation: 141

i use alt+s for editor.action.smartSelect.grow.

{
  "key": "alt+s",
  "command": "editor.action.smartSelect.grow",
  "when": "editorTextFocus"
}

Upvotes: 14

Related Questions