Shortcut key to select word in Eclipse

Solution 1:

Shift + Alt + selects enclosing elements.

Shift + Alt + reverses Shift + Alt + .

Shift + Alt + selects enclosing elements moving up the file.

Shift + Alt + selects enclosing elements moving down the file.

Solution 2:

The quickest way to find any keyboard shortcut in Eclipse is to use Help->Key Assist (or Ctrl + Shift + L), which will pop up a nice tooltip with keyboard shortcuts and what they do. (If you press he Key Assist shortcut twice, you'll get the Keys Preferences page, which allows you to reassign shortcuts.)

String |myFancyString = "FooBar";

If your cursor is immediately to the left of 'm' (I am indicating this with a pipe (|)) :

  • Shift + Alt + (Select Next Element) would select 'myFancyString'

  • Shift + Alt + (Select Previous Element) would also select 'myFancyString'

  • Ctrl + Shift + (Select Next Word) would select 'my', repeating it would select 'myFancy', followed by 'myFancyString '

Solution 3:

Shift + Alt + selects the word surrounding the cursor