Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CamelHumps support #541

Closed
alisabzevari opened this issue Nov 24, 2015 · 23 comments
Closed

Add CamelHumps support #541

alisabzevari opened this issue Nov 24, 2015 · 23 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@alisabzevari
Copy link

Like atom it is a good feature to move cursor around parts of a camel cased word with Alt+Right and Alt+Left

@egamma egamma added the feature-request Request for new features or functionality label Nov 24, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@oliverjanik
Copy link

+1

Although I would prefer it Resharper Style where it changes the behavior of the standard Ctrl + Left and Ctr + Right hotkeys.

@agorshkov23
Copy link

+1
maybe write plugin?

@akamud
Copy link
Contributor

akamud commented Jan 16, 2016

Someone already did. As for the key bindings, you can always change the default.

@gordey4doronin
Copy link
Member

The plugin works fine!

However, this is such a default functionality (at least in other IDEs).
Shouldn't it be out of the box?

@Seldaek
Copy link

Seldaek commented Nov 15, 2016

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.

@kabirbaidhya
Copy link

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.

@obrejla
Copy link

obrejla commented Mar 9, 2017

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!

@raksa
Copy link

raksa commented May 7, 2017

i hope have this feature soon, sorry that i can't help anything just only wait for

@markoczy
Copy link

markoczy commented Oct 9, 2017

+1 This feature lacks in vs code but should be standard for any modern file editor related to coding

@keremispirli
Copy link

+1

@benjaminjackman
Copy link

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

@macbem
Copy link

macbem commented Mar 19, 2018

Still not done? :(

@anfe0690
Copy link

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 :/

@kbd
Copy link

kbd commented Jun 11, 2018

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:

  • (cmd)←→ = beginning, end of line
  • (opt/alt)←→ = previous, next word
  • (ctrl)←→ = previous, next part of word

These are the keybindings Sublime Text, as well as the "Subword Navigation" plugin (first one linked above), use.

@morgzz
Copy link

morgzz commented Jul 3, 2018

+1

@V-ed
Copy link
Contributor

V-ed commented Jul 3, 2018

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!).

@alexdima
Copy link
Member

alexdima commented Jul 4, 2018

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" },

@alexdima alexdima closed this as completed Jul 4, 2018
@kbd
Copy link

kbd commented Jul 5, 2018

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".

@reduckted
Copy link

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 😕

@mccalltd
Copy link

mccalltd commented Jul 6, 2018

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.

@V-ed
Copy link
Contributor

V-ed commented Jul 6, 2018

@mccalltd There are some issues opened for that, such as #53645.

@mccalltd
Copy link

mccalltd commented Jul 6, 2018

Thanks @V-ed I'll track that issue. 👍

@alimbada
Copy link

alimbada commented Jul 6, 2018

Great progress. It'd be nice if this feature were extended to allow sub-word selection with the mouse too as IntelliJ does.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests