Search code examples
javaintellij-idea

How To Delete Keywords Separately by Capital Letters (Ctrl+Backspace) in IntelliJ IDEA


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?


Solution

  • 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->Smart Keys: Honor "CamelHumps" words settings when selecting on double-click.