I have added the following keyboard shortcuts to vscode, so when I hold control, and hit left or right, it will navigate and delete by subwords, rather than whole words (this is how I have it in SublimeText).
{ "key": "ctrl+right", "command": "cursorWordPartRight", "when": "textInputFocus" },
{ "key": "ctrl+left", "command": "cursorWordPartLeft", "when": "textInputFocus" },
{ "key": "ctrl+delete", "command": "deleteWordPartRight", "when": "textInputFocus" },
{ "key": "ctrl+backspace", "command": "deleteWordPartLeft", "when": "textInputFocus" }
So if I had the word "CamelCase" and the caret was on the first C in camel, hitting control+right would move the cursor to the first C in Case, instead of the the last word.
The only problem is that now vscode treats every single character of white space as an indivisual subword, instead of all contiguous strings of white space as a single subword.
For example if I have the two words separated by 4 spaces....
wordOne wordTwo
pressing control+right, while the cursor is at the first whitespace char (after the e), should just jump all 4 white space characters to the first w in wordTwo....but this is not the case.
Is there a way to configure the editor such that this behaviour is achievable?
Turns out this was a bug that was fixed in a later insider version of VSCode.
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