如何在 IntelliJ IDEA 中选择骆驼化词的单个词

在 IntelliJ IDEA 中,穿越或选择骆驼化单词的单词的捷径是什么?假设我有一个 LongMultiWordVariableName,我希望能够将光标移动到每个单词,以便编辑或选择变量的一部分。

Eclipse 有一个快捷方式来执行这个 Ctrl + /(用于移动)和 Ctrl + Shift + /(用于选择)。

18453 次浏览

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 )

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.

There is a shortcut in latest version of Android Studio. You can just tap "Shift" key twice(double click) and then in search type "camelhum" then the option will appear and you can toggle it on/off. I have attached an image for reference.enter image description here

As of 2022 when using Rider 2022.2.3 you go to Settings then under the Keymap section, you can search for camelhump to see the actions and their shortcuts:

Settings window, Keymap section

In my case I could already use Alt+Left/Right to navigate between sub-words, but I had to define custom shortcuts to do that while selecting the sub-words. You can set the shortcut by right-clicking one of the actions and choosing Add Keyboard Shortcut:

Context menu for setting keyboard shortcut