'IntelliJ IDEA backspace and indention?

Here's two scenarios:

Eclipse (or perhaps even other programs?): If I indent, such as pressing tab or similar: Step 1: ( | is the caret )

public text(){
     |
}

Step 2: I press backspace:

 public text(){
 |
    }

See how one press of backspace moves back a whole indent since it's all empty space? Similarily, if I indent four times with TAB I'd press 4 backspaces, each moving one empty spaced indent.

Is this possible with IntelliJ because right now, I'm forced to spam the backspace key because it only moves back one step? As in, if I wanted to achieve the same result as in Step 2, I'd have to backspace like 4-5 times.



Solution 1:[1]

Just in case someone else stumbles upon this in the future, this is now a standard option found at:

Preferences -> Editor -> General -> Smart Keys. Then under the Backspace section choose the Unindent option you like

Solution 2:[2]

When you press TAB in IntelliJ's Java editor by default you get 4 spaces instead of a single TAB character. You can change this behavior through File>Settings>Code Style>Java>Tabs and Indents. Just chek the 'Use tab character' check box.

Solution 3:[3]

You may want to try this really handy plugin for intellij: hungry backspace It "eats" all the white spaces when you hit backspace! Something close to that but not as good would be typing ctrl + backspace.

Solution 4:[4]

Press SHITF+TAB to unindent.

There is nothing in the preferences that will allow as simple as SHIFT+TAB

Solution 5:[5]

If you're finding IntelliJ's backspace too aggressive, this will make it only delete one tab at a time (currently the default behavior deletes all the tabs on the current line and jumps the caret up to the end of the previous line).

File -> Settings -> Editor -> General -> Smart Keys

Unindent on Backspace: To nearest indent position

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Keegan Lillo
Solution 2 GareginSargsyan
Solution 3 sakis kaliakoudas
Solution 4 ARK
Solution 5 Alex Ertl