1

I am programming and from Windows I'm used to use the "shift" + "alt" + "arrow key right/left" keys to select a part from a word until the next capital letter starts. But on my Mac this shortcut only selects the whole word. Can this be done somehow on a Mac too?

For example:

myVariable (is the text to select, cursor is at the beginning (before 'm')).

Now using the shortcut "shift" + "alt" + "arrow key right" would select only 'my':

myVariable ('my' is selected, pressing it again would then select the whole word.)

This is a shortcut often needed for example when programming using the programming language Java.

  • This may be application-specific. Standard Mac toolbox for that key combo would just be 'add next letter to selection'. Opt/shift/arrow would be add next word. I've never know the 'add until next upper-case' structure at all, but maybe someone else would know. – Tetsujin May 6 '17 at 14:01
  • @grgarside Sorry, yes, you are right! I forgot to mention the "alt" key. – trinity420 May 6 '17 at 14:15
1

I found a solution to my problem, but it only works for the IDE (development environment) I am using, which is the program IntelliJ IDEA, and not system wide. But that fits my needs.

Solution:

Go to Preferences > Keymap > Search for "move caret to" > Select "Move Caret to Next Word in Different "Camel Humps" Mode" > Double Click it and select "Add keyboard shortcut" > Enter any shortcut you want.

You may also set a shortcut for doing the same thing but in the different direction.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .