4

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 :)

Hulk1991
  • 3,079
  • 13
  • 31
  • 46
Jarek
  • 235
  • 2
  • 12
  • http://stackoverflow.com/questions/200499/visual-studios-keybindings-for-eclipse – RC. Jan 21 '10 at 17:51

3 Answers3

3

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.

Hulk1991
  • 3,079
  • 13
  • 31
  • 46
Andres
  • 5,012
  • 3
  • 24
  • 36
  • 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 Jan 21 '10 at 18:26
  • 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 Oct 29 '10 at 16:55
2

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 from habit.) See also this blog post. Unfortunately I don't see any way to have anonymous shortcuts, you must type a name. (Edit: After using it for a while I find named bookmarks are quite a bit more useful than anonymous, and the currently selected word will be automatically used for the bookmark name so little typing is necessary.)
  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
  • 2,919
  • 21
  • 22
0

Go to:
Window -> Preferences -> General -> Keys -> Scheme (dropdown) -> Microsoft Visual Studio

You get almost all Visual Studio shortcuts on a silver palate.

Ambran
  • 2,367
  • 4
  • 31
  • 46
  • This isn't present in all eclipse versions.. You need to add C/c++ development plugin and even then, only a handful of keys are mapped – Lombas Aug 24 '18 at 17:23