Navigate through camel case

2019-03-02 03:23发布

问题:

I was working with Eclipse and I want that I can jump between words written in camel-case by pressing STRG. Now I'm working with Sublime and I can't find a shortcut to do so nor a plug-in, which achieves it.

The following example shows my problem

aFunctionName

In Eclipse it jumps from a to the F to the N of aFunctionName, when I press STRG + RIGHTARROW. In Sublime it skips the whole word. Is there a shortcut, a plug-in or can I set an entry into the config?

回答1:

In Sublime Text, this functionality is bound to alt+right by default. In ST lingo it's referred to as "subwords" rather than having any reference to camelCase.

From the default keybindings:

{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },