Search code examples
eclipseindentationbackspace

Configure eclipse so that backspace unindents


Having eclipse configured to use space instead of tabs, is it possible to configure eclipse so that the backspace key unindents like the tab key indents?

A demonstration to clarify what I mean with backspace unindent (the vertical bar stands for cursor position and the dots for spaces):

if(bar == 0) {
|foo = 0;
}

Pressing tab will indent 4 spaces:

if(bar == 0) {
....|foo = 0;
}

Pressing backspace only goes back 1 space:

if(bar == 0) {
...|foo = 0;
}

What I want is that it goes back 4 spaces:

if(bar == 0) {
|foo = 0;
}

Solution

  • The feature will finally be available for next version of Eclipse 4.14 planned for 2019-12 https://www.eclipse.org/eclipse/news/4.14/platform.php#delete-spaces-as-tabs

    Backspace/delete can treat spaces as tabs If you use the Insert spaces for tabs option, now you can also change the backspace and delete keys behavior to remove multiple spaces at once, as if they were a tab. The new setting is called Remove multiple spaces on backspace/delete and is found on the General > Editors > Text Editors preference page.