开发者

Does Eclipse support keyboard shortcuts known from Visual Studio?

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 curs开发者_Python百科or 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 :)


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.


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.


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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜