84

Is there any keyboard shortcut to select a word? Or may be it can be assigned some how?

4 Answers 4

141

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.

6
  • 8
    Use Shift + Control + arrows on the Mac.
    – Chei
    Commented Sep 20, 2012 at 12:47
  • 1
    It seems these bindings are broken in Kepler (Version: 4.3.1.v20130911-1000, Build id: M20130911-1000). I guess it might be due to the fact they use arrow keys and it seems there are problems with shortcuts using these keys for some time now. See for instance bugs.eclipse.org/bugs/show_bug.cgi?id=376491 Commented Jan 16, 2014 at 10:07
  • 1
    For Ubuntu it's also Shift+Ctrl
    – Tim
    Commented Jun 5, 2014 at 10:26
  • I think the answer isn't exactly. I am using Eclipse Luna 4.4
    – Vy Do
    Commented Nov 30, 2014 at 14:29
  • I'm using Kepler Service Release 1 on Windows and shift+alt+arrow selects just fine. I'm using Luna on Mac and the equivalent selection does nothing. Presumably this functionality has been broken in Luna (or earlier).
    – jsaven
    Commented Jun 11, 2015 at 2:08
31

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 '

2
  • Thank you Joshua for that info!
    – alex2k8
    Commented Jan 12, 2010 at 16:00
  • Do you know the difference between the three commands (Select Next|Previous|Enclosing element)? It seems they extend the selection with the same result in all situations I throw. Commented Jul 22, 2016 at 8:14
10

Shift + Alt + selects the word surrounding the cursor

0
3

To select, you can use Shift + Alt + any arrow key.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.