Like atom it is a good feature to move cursor around parts of a camel cased word with Alt+Right and Alt+Left
+1
Although I would prefer it Resharper Style where it changes the behavior of the standard Ctrl + Left and Ctr + Right hotkeys.
+1
maybe write plugin?
Someone already did. As for the key bindings, you can always change the default.
The plugin works fine!
However, this is such a default functionality (at least in other IDEs).
Shouldn't it be out of the box?
Sorry for the spam folks but in the interest of searchability (because it took me quite some time to find this via other closed issues), I'll add a few keywords here: subword navigation, word navigation with camelCase, move by word break on capitals, wordSeparators.
And FWIW, I am happily using the extension which works wonders, and allowed me to restore sublime text-like functionality using alt[+shift]+left/right/del/backspace.
I think both full-word navigation and subWord (or camelHumps style) navigation are very useful features. Currently I'm also using this plugin https://marketplace.visualstudio.com/items?itemName=ow.vscode-subword-navigation to enable the sub word navigation.
I'm using these key mapping:
[Shift+] Ctrl + Left/Right for full word selection/navigation (default)
[Shift+] Alt + Left/Right for sub word navigation
But I think it should be added to core instead of using it as a plugin as all the popular editors like: Sublime, Atom, Webstorm etc. support it out of the box.
Ou, I really miss that functionality... I'll use the plugin, but this is the base functionality, it should definitely be the part of the editor. Thanks!
i hope have this feature soon, sorry that i can't help anything just only wait for
+1 This feature lacks in vs code but should be standard for any modern file editor related to coding
+1
Just linking this an issue from this very nice extension that adds the functionality to the editor, to see if anyones know if there are more points in the API to hook into allowing it to work in search / rename / other input type boxes: https://github.com/ow--/vscode-subword-navigation/issues/12
Still not done? :(
I switched from another text editor that I had been using for a long time because Visual Studio Code seems to be better.
But now, I'm starting to miss this functionality :/
There currently seem to be three extensions that provide this functionality:
https://github.com/ow--/vscode-subword-navigation
https://github.com/mlewand/vscode-select-part-of-word
https://github.com/maptz/Maptz.VSCode.Extensions.CamelCaseNavigation
This functionality should really be part of core.
FWIW, as a Mac user, shortcuts I'd expect:
These are the keybindings Sublime Text, as well as the "Subword Navigation" plugin (first one linked above), use.
+1
This feature has been added by the PR #48023 and will be available in the 1.25 release of VSCode (proof).
It seems that @alexandrudima is using the issue #46203 as the source of this addition, just to point it out because there is recent activity here, which seems to not know this has been added (_and is even in the Insiders already!_).
Yes, thanks to @brentwang23 for the PR!
Here is an example for how you can bind the new commands:
{ "key": "ctrl+right", "command": "cursorWordPartRight",
"when": "textInputFocus" },
{ "key": "ctrl+shift+right", "command": "cursorWordPartRightSelect",
"when": "textInputFocus" },
{ "key": "ctrl+left", "command": "cursorWordPartStartLeft",
"when": "textInputFocus" },
{ "key": "ctrl+shift+left", "command": "cursorWordPartStartLeftSelect",
"when": "textInputFocus" },
{ "key": "ctrl+backspace", "command": "deleteWordPartLeft",
"when": "textInputFocus && !editorReadonly" },
{ "key": "ctrl+delete", "command": "deleteWordPartRight",
"when": "textInputFocus && !editorReadonly" },
Here is an example for how you can bind the new commands...
@alexandrudima do we need to add this to our user config or will these be added to the defaults when 1.25 is released? If they won't be added to defaults, why? Thanks!
Edit: just saw 1.25 was just released. It does have defaults but they're not ideal on Mac. The defaults on Mac should be what you provided above (ty!) but it looks like they're what's listed in the 1.25 release on all platforms. i.e. move subword right is "ctrl+alt+right" instead of "ctrl+right".
It does have defaults but they're not ideal on Mac.
Nor are they ideal for Windows. Not really sure why Ctrl + Alt + Del was considered a good default for a shortcut key 馃槙
The fix released in 1.25.0 is great, but one thing is missing, IMO. ALL_CAPS is not treated as two words ALL and CAPS, and subword navigation visits each capitalized letter.
@mccalltd There are some issues opened for that, such as #53645.
Thanks @V-ed I'll track that issue. 馃憤
Great progress. It'd be nice if this feature were extended to allow sub-word selection with the mouse too as IntelliJ does.
Most helpful comment
+1
Although I would prefer it Resharper Style where it changes the behavior of the standard Ctrl + Left and Ctr + Right hotkeys.