Is there any keyboard shortcut to select a word? Or may be it can be assigned some how?
4 Answers
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.
-
8
-
1It 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
-
I think the answer isn't exactly. I am using Eclipse Luna 4.4– Vy DoCommented 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).– jsavenCommented Jun 11, 2015 at 2:08
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 '
-
-
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