How to navigate through the source code by parts in CamelCase (instead of whole words)?

Intellij IdeaNavigationPycharmCamelcasing

Intellij Idea Problem Overview


I remember when I was using Eclipse that when holding CTRL and using left or right arrows Eclipse would navigate over the LongCamelCaseWrittenWord in several steps. One camel case word at time.

So it will go like follows (pipe | represents the actual cursor position):

|LongCamelCaseWrittenWord -> CTRL+RIGHT_ARROW ->
Long|CamelCaseWrittenWord -> CTRL+RIGHT_ARROW ->
LongCamel|CaseWrittenWord -> CTRL+RIGHT_ARROW ->
LongCamelCase|WrittenWord -> CTRL+RIGHT_ARROW ->
LongCamelCaseWritten|Word -> CTRL+RIGHT_ARROW ->
LongCamelCaseWrittenWord|

Is there a way how to achieve this in IntelliJ? Currently IntelliJ steps over the whole word at once.

Using IntelliJ 9.0

Intellij Idea Solutions


Solution 1 - Intellij Idea

Yes, enable Use "CamelHumps" words in Settings | Editor | General | Smart Keys.

Solution 2 - Intellij Idea

As answered elsewhere, you can enable Use "CamelHumps" words in Settings | Editor | General | Smart Keys to switch the shortcuts to work with camelCase instead of whole-word.

You can also access the previous behavior by assigning keyboard shortcuts to the appropriate actions under Settings | Appearance & Behavior | Keymap | Editor Actions. This image shows an example where I access the previous behavior by adding ctrl:

keymap screenshot

Solution 3 - Intellij Idea

You can have both functionalities at the same time:

  1. In "Settings->Editor->General->Smart Keys", disable "Use CamelHumps words".
  2. In "keymap", create shortcuts for:
  • "Move caret to next word"
  • "Move caret to next word in different camelhumps mode"

Note that these steps correspond to IntelliJ 14, so they might be slightly different in other versions.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJan ZykaView Question on Stackoverflow
Solution 1 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 2 - Intellij IdeaCarl GView Answer on Stackoverflow
Solution 3 - Intellij Ideablue_noteView Answer on Stackoverflow