Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 727
user3671996 Avatar asked Jul 21 '14 09:07

user3671996


People also ask

What is Ctrl Alt L in IntelliJ?

Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.

How do I select multiple instances in IntelliJ?

To select ranges as multiple rectangular selections, Ctrl+Alt+Shift+Click and drag the mouse over the desired parts of code. As a result, you will have multiple selection ranges in each affected document line.

How do I select all occurrences of a word in IntelliJ?

Use ⌃⌘G (macOS), or Ctrl+Alt+Shift+J (Windows/Linux), to select all occurrences of the same word.

How do I navigate code in IntelliJ?

Navigate with the caretTo navigate backwards, press Ctrl+Alt+Left . To navigate forward, press Ctrl+Alt+Right . To navigate to the last edited location, press Ctrl+Shift+Backspace . To find the current caret location in the editor, press Ctrl+M .


1 Answers

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.

like image 151
blue_note Avatar answered Sep 22 '22 05:09

blue_note