I've started using Visual Studio Code on MacOS.
Jumping with Alt+Left/Right is really annoying as it jumps by full identifier instead of just a word.
Examples:
I'd like e.g. Ctrl+Right to do the thing above and to modify the behaviour of Alt+Right so it jumps by word.
My desired behaviour:
Solution:
My final keybindings.json
config with the added Shift (select) options:
[
{
"key": "alt+left",
"command": "cursorWordPartLeft",
"when": "editorTextFocus",
},
{
"key": "alt+right",
"command": "cursorWordPartRight",
"when": "editorTextFocus",
},
{
"key": "shift+alt+left",
"command": "cursorWordPartLeftSelect",
"when": "editorTextFocus"
},
{
"key": "shift+alt+right",
"command": "cursorWordPartRightSelect",
"when": "editorTextFocus"
},
{
"key": "ctrl+left",
"command": "cursorWordStartLeft",
"when": "editorTextFocus"
},
{
"key": "ctrl+right",
"command": "cursorWordEndRight",
"when": "editorTextFocus"
},
{
"key": "shift+ctrl+left",
"command": "cursorWordStartLeftSelect",
"when": "editorTextFocus"
},
{
"key": "shift+ctrl+right",
"command": "cursorWordEndRightSelect",
"when": "editorTextFocus"
},
]
However, when you are working on a task, you will find yourself quickly jumping between the same set of files. VS Code provides two powerful commands to navigate in and across files with easy-to-use key bindings. Hold Ctrl and press Tab to view a list of all files open in an editor group.
I've started using Visual Studio Code on MacOS. Jumping with Alt + Left/Right is really annoying as it jumps by full identifier instead of just a word. I'd like e.g. Ctrl + Right to do the thing above and to modify the behaviour of Alt + Right so it jumps by word. My final keybindings.json config with the added Shift (select) options:
My fingers are programmed to use ctrl+right arrow to jump a word forward, ctrl+left arrow to jump a word back, in Terminal. I have disabled Mission Control.
"Tips and Tricks" lets you jump right in and learn how to be productive with Visual Studio Code. You'll become familiar with its powerful editing, code intelligence, and source code control features and learn useful keyboard shortcuts.
You are looking for
cursorWordPartRight
which is bound to Shift-Alt-Q.
Alt-Right is bound to a "Go Forward
" command, you could delete that binding and use it for the cursorWordPartRight
command.
{
"key": "alt+right",
"command": "cursorWordPartRight",
"when": "editorTextFocus",
},
{
"key": "alt+left",
"command": "cursorWordPartLeft",
"when": "editorTextFocus",
}
It may require that each language parser support it though. It does work in JavaScript.
cursorWordPartLeft (command exists but is unbound by default).
There are also these other unbound relevant commands:
cursorWordPartRightSelect
cursorWordPartLeftSelect
cursorWordPartStartLeft
cursorWordPartStartLeftSelect
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