Reputation: 21275
In IntelliJ, if the editor cursor is in the middle of a word like this w|ord
and you press Ctrl+W, it will highlight the whole word which allows you to highlight the whole word without moving the cursor to the end or the beginning of the word then do ctrl+shift+left/right arrow.
Is there an equivalent shortcut in Eclipse?
Upvotes: 26
Views: 5516
Reputation: 2460
While previous answers cover what to look for in Eclipse, this answer is to document restoring this useful shortcut set. In Eclipse Mars, for example, I found these shortcuts initially unbound.
To (re)enable, therefore, the Ctrl+Shift+up and Ctrl+Shift+down (using Mac shortcuts by way of example), open Eclipse preferences, find the Keys section, and look for the following:
Upvotes: 0
Reputation: 846
You are looking for Alt+Shift+Up (Select Enclosing Element)
I'm using Eclipse Helios and you can change de shortcut in Window->Preferences->General->Keys
Upvotes: 39
Reputation: 16520
On Mac it is Ctrl+Shift+up and Ctrl+Shift+down
However, in any platform it is not nearly as clever as IntelliJ's Ctrl+W
For example, when you are inside a bracket, Ctrl+W excludes the brackets, whereas Eclipse includes the brackets, so there is no easy way to select everything within a bracket. It's the same problem with quotes.
Upvotes: 3