Accepted answer

In vim, you select the block and then press the < key.

In Eclipse you select it and then press SHIFT + TAB.

Every code editor worth its salt has a one-key way to indent and dedent blocks.


Use Preferences-Pydev-Editor settings uncheck change tabs to spaces. It makes detent errors and your problem. And test other options like 4 space tab, 8 space tab and so on.


Perhaps late for your case, but if useful for others:

SHIFT + TAB will do unindent for the selected text in Eclipse.


You could also replace the if statement with:

if True:  # if i < 5:

and leave everything else alone - no indent/dedent to undo later.

Related Query

More Query from same tag