Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;
}
like image 554
Lesmana Avatar asked Nov 30 '10 18:11

Lesmana


2 Answers

You know that "shift+tab" will outdent a line already, correct?

Hmmm, I just took a look at preferences->general->keys. I only see indent line there, no outdent (or anything useful under "dent").

Personally, I would say that backspace is the key I hit second most often, after space. Rebinding it would drive me bonkers.

like image 101
Alan Arvesen Avatar answered Oct 06 '22 13:10

Alan Arvesen


According to these very similar questions:

  • In Eclipse, how can spaces behave as tabs?
  • Is there a way to get Eclipse to treat 4 spaces exactly as it treats a tab?

it seems to be not possible :(

like image 36
Lesmana Avatar answered Oct 06 '22 13:10

Lesmana