17

I have been using eclipse for a while, now I'm using IntelliJ IDEA. There was a good feature in Eclipse that I would like to use it in IntelliJ. Here is the feature:

This is my variable name: int myVariableName; when I use this (Ctrl+Backspace) shortcut end of the variable (Cursor is next to letter 'e') name variable becomes -> int myVariable; so it deletes until capital letter in eclipse. (this is what I want, it deletes separately by capital letters)

The issue in IntelliJ is that it deletes all variable names, so I need to re-write again. Where can I customize this setting?

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
user3671996
  • 193
  • 2
  • 7
  • Some additional information in the answers to [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) – Joshua Goldberg Feb 22 '19 at 02:48

1 Answers1

44

Ctrl+backspace deletes previous "word".

"word" can be defined as:

  1. anything between two spaces (the default)
  2. camelCaseNotation

The default is option (1). To change to option (2), go to file->settings, search Smart Keys, and check Use "CamelHumps" words.

As noted in comments below, this setting will also cause double-clicking to select only part of a camel-case word. To restore double-click to select the whole word, uncheck Editor->General: Honor "CamelHumps" words settings when selecting on double-click.

Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
blue_note
  • 27,712
  • 9
  • 72
  • 90
  • 5
    while this solves problem described in question, this is not an ideal solution. now when you double click a word, you will only select one CamelHump and there's no way to select the whole thing. e.g. thisIsMyVariable : when double clicking on "My" only "My" is selected and triple-click selects the whole row, and there's not way to select "thisIsMyVariable" - very disappointing – Peter Perháč Apr 28 '16 at 18:47
  • 12
    @Peter Perháč you can disable the setting 'Honor "CamelHumps" words settings when selecting on double click' under Settings | Editor | General. Then a double click select the whole variablename – Daniel Käfer Jun 27 '17 at 09:18
  • They moved "Honor 'CamelHumps' under "Smart Keys" next to "Use 'CamelHumps'" – ScrappyDev May 25 '23 at 12:56