views:

110

answers:

2

First, I know it is possible to setup Visual Studio keyboard scheme in Eclipse after installing CDT plugin, but unfortunately most useful keys only work with C/C++ sources, not with Java.

I'm trying to configure Java editor but I'm unable to find some of most useful shortcuts...

Go to declaration (VS: Ctrl+F12) / go to definition... (VS: F12) / Go back (Ctrl+Num*)
Quick identifier under cursor search (VS: Ctrl+F3)
Code autoformat (VS: Alt+F8)
Quickly set anonymous bookmark (VS: Ctrl+F2) / Go to next bookmark (VS: F2)

Probably more to come :)

+2  A: 

From http://www.eclipsezone.com/eclipse/forums/t76435.rhtml

"... you can display a list of all the hotkeys in Eclipse using Ctrl+Shift+L .

... It's possible to customize the hotkeys in Eclipse through Window->Preferences...->General->Keys. "

Edit: Some of the ones you are looking for include:

  • Format = Ctrl+Shft+F
  • Open declaration = F3
  • Last edit location = Ctrl+Q
  • Go back = Alt+Left
  • Next annotation(bookmark) = Ctrl+.
  • Previous annotation(bookmark) = Ctrl+,

You can set a hotkey for new bookmark in the keys menu.

Annotations can include bookmarks if you check them on the drop down menu.

Hopefully that helps a little.

Andres
I know how to customize and view active shortcuts, but I can't see ones I need. Maybe I'm missing them, or maybe I need some plugin to do what I want...
Jarek
To clarify for future people like me: "check them on the drop down menu" refers to the dropdown menu on the Next/Previous Annotation buttons on the toolbar.
Nathan Kidd
A: 

The best approximation to Visual Studio's bookmarks (CTRL+K CTRL+K = set, CTRL+K CTRL+N = next, CTRL+K CTRL+P = previous) that I've found is:

  1. Set a keyboard shortcut for adding a bookmark. Window -> Preferences -> General -> Keys. (I used CTRL+K CTRL+K from habit.) See also this blog post. Unfortunately I don't see any way to have anonymous shortcuts, you must type a name.
  2. As Andres said, select Bookmarks in the drop-down menu of your Next Annotation button on the toolbar.
  3. Now you can use CTRL+, and CTRL+. to move between bookmarks.
Nathan Kidd