ChatGPT解决这个技术问题 Extra ChatGPT

How do I select individual words of a camelized word in IntelliJ IDEA

What is the shortcut in IntelliJ IDEA to move across or select individual words of a camelized word? Lets say I have aLongMultiWordVariableName, I want to be able to move the cursor to each word for editing or select parts of the variable.

Eclipse has a shortcut to do this Ctrl+←/→ for move and Ctrl+Shift+←/→ for selection.

Surely I am not the only one that read "caramelized" ? ;)
mmmmmm, caramelized words ...

M
Matt_Bro

IDEA has the same keystrokes as Eclipse for camel-case words, but you have to have the CamelHumps option turned on (it's in Settings -> Editor -> General -> Smart Keys -> Use "CamelHumps" words )


Same accomplished with Ctrl+Shift+A -> "camelhumps" -> down arrow -> enter. Sounds more troublesome, but Action Search is very nice.
@andersoyvind Thanks for mentioning Ctrl+Shift+A!!! This must be the most powerful shortcut in the universe.
It is Editor -> General -> Smart Keys now (as in Intellij 14 on Mac os X as of Oct 22 2015). As noted by romaintaz, this setting must be combined with turning off "Honor CamelHumps words settings when selecting on double click", which can be found under "Settings -> Editor -> General" the mouse section.
R
Romain Linsolas

Yes, the answer of yalestar is correct. Settings > Editor > Smart keys > Use "CamelHumps" words

However, here is something that can be usefull to know: If you want to be able to select the whole word by double-click on it, unselect the "Honor 'CamelHumps' words settings when selecting on double click" in Settings > Editor.


The mouse setting is quite useful when navigating and selecting code in remote sessions.
Update (Idea 15): "Use CamelHumps words" is in Editor>General>SnartKeys, "Honor CamelHumps ... on double click" is in Editor>General.
I was looking for this double-click-camelcase feature, thanks!
H
Hitesh Bisht

https://i.stack.imgur.com/HFfjV.jpg


up for the screen cap
thanks! It is helpful in case you would like to double click on a word to select whole with CamelHump turned on.