Reputation: 3857
Is there any way in Visual Studio Code to prevent "over-selection" when using Shift + Alt + RightArrow
combo?
E.g. if I'm at the end of line 4 below and I hit that key combo, VS Code selects up until the end of bar
which is never what I want and means I always have to unselect the last word:
In JetBrain's WebStorm for example, it only selects up to start of bar
which is much more useful:
Upvotes: 1
Views: 252
Reputation: 3857
Ok, got it. This is controlled by the "alt+right"
and "shift+alt+right"
settings in the keybindings.json
file.
By default they map to cursorWordEndRight
and cursorWordEndRightSelect
respectively. You can map them to cursorWordStartRight
and cursorWordStartRightSelect
by adding the following entries in your keybindings.json overrides file:
[
{ "key": "alt+right",
"command": "cursorWordStartRight",
"when": "editorTextFocus"
},
{ "key": "shift+alt+right",
"command": "cursorWordStartRightSelect",
"when": "editorTextFocus"
},
]
Tip: you can get to the keybindings.json
file that by going to edit Keyboard Shortcuts. There's a link to edit the file at the top.
Upvotes: 1