Configure Eclipse word-boundaries so 'Next-Word-Key' skips whole identifier

If you want a very simple way to select a entire word without the need to disable smart caret positioning.

You can use at the beginning of word or inside the word: Shift+Alt+Right

At the end or in the middle of word: Shift+Alt+Left


Coming to Eclipse from XCode, I found the default navigation annoying. In Eclipse, Alt+Left and Alt+Right move to the next camelcase segment, and Ctrl+Left/Right does nothing. In XCode, Alt+Left/Right moves between words and Ctrl+Left/Right moves between camelcase segments. This allows you to control how fine-grained your navigation is.

How I fixed this for myself was by going into Preferences > General > Keys, searching for "Word", and changing the "Next Word" and "Previous Word" bindings from Alt+Left/Right to Ctrl+Left/Right. Then the Alt-navigation is by word and the Ctrl-navigation is by camelcase segment, as in XCode.

I thought this might be useful to some.

Edit:

As I continue to use these new settings, I've found another point:

Although navigation works as advertised, selection has some funky behavior. Namely, Shift+Ctrl+Left/Right can sometimes select large blocks of text instead of just the next camelcase component.

To fix this, again go to Preferences > General > Keys, search for "Select".

Set "Select Next/Previous Word" to Shift+Ctrl+Right/Left. Unbind "Select Next/Previous Element" (there are three "Whens" to pick from, I unbound all 3).

Voila.


Try and unselect the option:

Preferences / Java / Editor / Smart caret positioning in Java names

alt text

And see if that enhances the user experience in term of cursor positioning.

If this is not Java, you have a similar option in:

Preferences / General / Editors / Text Editors / Smart caret positioning at line start and end

It is usually selected, meaning if the cursor still stops at every word, that may suggests another setting for a specific language is overriding it.