15

Hi I'm new to IntelliJ IDEA and got here and there usability issues, because I'm coming from Eclipse.

When I rename a variable and want to mark the second part of it by hitting Ctrl+Shift+Right, the cursor moves to the next word which is outside of the border for renaming and when I type the new name and click Enter, the rename isn't executed for the other usages of the variable. Is there a setting where it's possible to change the behavior of Ctrl+Shift+Left/Right so that the caret moves right after the last character of the variable name?

Second question

When I'm moving the cursor through a variable name with Ctrl+Left/Right the next stop in Eclipse was always before the next upper case letter. Is in Idea also a setting to activate this? This would be very helpful when renaming variables.

Community
  • 1
  • 1
Rooboo
  • 243
  • 3
  • 11
  • 1
    every can be configured through the File > Settings > Key Map, take a look at this post for the camel case http://stackoverflow.com/questions/5833544/can-intellij-navigate-through-the-source-code-by-camelcase-instead-of-whole-word – poussma Jan 17 '13 at 10:40
  • Thanks for the camel case hint, but why the heck destroys it marking a variable by double clicking on the name? Now just a party of the name is selected instead of the whole name. Why??? – Rooboo Jan 17 '13 at 13:57
  • Ok, found it in the parent section: Honor "CamelHumps" word settings when selecting using double click should be disabled... – Rooboo Jan 17 '13 at 15:13
  • Placing two questions in one is discouraged in stackexchange. Please avoid this. If you have two questions, post two questions. – Mike Nakis Jul 17 '13 at 18:08
  • Possible duplicate of [How to navigate through the source code by parts in CamelCase (instead of whole words)?](https://stackoverflow.com/questions/5833544/how-to-navigate-through-the-source-code-by-parts-in-camelcase-instead-of-whole) – phuclv Nov 21 '17 at 17:14

2 Answers2

31

What you exactly need is [I have jIdea 12.1]:

  1. Go to settings [Ctrl+Alt+S]
  2. Choose [Editor -> General -> Smartkeys]
  3. Check the [Use "CamelHumps" Words] button

Вуаля!

Community
  • 1
  • 1
sergpank
  • 988
  • 10
  • 18
  • 9
    As the side effect this makes the double-click select only the humps and not the whole word. To select whole word on double-clicking, go to Settings -> Editor and uncheck [Honor "CamelHumps" words settings when selecting on double click]. – janhink Dec 08 '14 at 09:10
  • Editor -> General, at least on MacOS! – IEatBagels Mar 16 '15 at 18:45
2

Ctrl+Alt+S and select Keymap from settings, you can change what you want it to there.

But I would suggest using the autocomplete/intellitext features of IntelliJ and the refactoring tool, without manually navigating through variable names - they normally get it right first time.

Jawa
  • 2,336
  • 6
  • 34
  • 39
NimChimpsky
  • 46,453
  • 60
  • 198
  • 311