views:

554

answers:

4

In some editors there exist plugins implementing a feature called "hungry backspace" or "hungry delete".

If this mode is active in a text editor then one hit to the backspace key will automatically delete all whitespace chars backwards from the current cursor position up to the first non-whitespace character.

For example, this feature exists for Emacs and IntelliJ IDEA.

Does anyone know if it is also available in Eclipse?

+1  A: 

Alt-Del is probably as close as you're going to get without writing a plugin yourself. Others have asked for this feature (coming from intelliJ) but so far it doesn't exist, or it's not published.

Adam Davis
What is it supposed to do? In my Eclipse 3.4.1, it does nothing.
PhiLho
Do you mean ctrl+del, which deletes the next word?
Adam Jaskiewicz
+1  A: 

CTRL-backspace is pretty close too: delete previous word:

function();    (4 spaces)

+ CTRL-BACKSPACE gives:

function

Other than that, AnyEdit plugin can convert trailing spaces into tabs (but also into "", effectively removing them)

VonC
Delete previous word is rather Ctrl+Backspace. Ctrl+Delete is Delete next word...At least on my copy.
PhiLho
You are right: I edited my answer accordingly
VonC
A: 

In SciTE, and Eclipse (3.4), Ctrl+Shift+Del with the caret after the last visible character will delete these spaces. Ie. it deletes from caret to end of line.

Actually, in SciTE I don't need to do that, since I have set it up to automatically remove these trailing spaces when saving.

Note: In Preferences > General > Keys, there is a Remove Trailing Whitespace binding (without key assignment by default) which seems to apply to File.

PhiLho
CTRL + ALT + ... DEL ? On my windows desktop, it does not delete anything, but it does bring the logon screen, asking me if I want to lock my session ;)
VonC
Whoops! It was Ctrl+Shift+Del, of course! :-D Everybody can make a typo... ;-)
PhiLho
+1  A: 

Ctrl+Shift+Left, Backspace always works for me. works in notepad, web browsers, everywhere. Stick to the standards :)

Dean
Yes I use these patterns very much. But this one selects text up to the beginning of the previosu word. That's a little annoying since I only want to delete up to the end of that word.
mkoeller