Eclipse Debugger Loses Focus when Switching Files - eclipse

When debugging (Juno, SR1 on mac) I prefer using the keyboard keys instead of the mouse to step, step into, step out, go, etc. But these keyboard shortcuts only seem to work when the editor is in focus. The real problem happens when stepping in or out to another file. The editor correctly shows the current line in the new file, but that file is not focused. Consequently, I must grab the mouse and click in that view to re-enable the hotkeys.
This drags my debugging down to a crawl, as I'm constantly having to use the mouse instead of touch-typing. Searches don't find quite this issue. Anyone with work-arounds?

It depends on the Eclipse version. Eclipse 4.2 sucks on Windows and Ubuntu - Due to a bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372941.

Maybe you can change the key bindings:
Go to Window->Preferences - General->Keys, search for "step into", etc. And change in the select box: "When:" to "In Windows" (from "Debugging") or experiment with it to get result you want.
Setting it to "In Windows" I could "Step into" from any focused Eclipse component e.g. Package Manager, Console, Breakpoints, Servers, etc. And even when stepping into file.

Related

Eclipse on Mac OS X : Shortcuts are broken

I'm pretty new to Eclipse because I'm starting to learn Java Programming. I'm having problem with the editor.
I'm running Eclipse on an iMac with a German keyboard. The keyboard shortcut for "Redo" action is Cmd+Shift+Z.
When I use this shortcut, a tiny window in the right down corner pops up and asks if I want "Inspect" or "Redo"...
In the preferences, I have three different "Inspect", (just one was with a shortcut, but it was something like Cmd+Shift+I). Anyway, I erased it to be sure.
Afterwards I tried again, but the same little window asks me for Insect or Redo. Now I don't know what to do.
I'm having the same problem with Cmd+R ("Run" action). For "Run" there is another keyboard binding.
In Eclipse preferences, I could not find both commands that are on the same shortcuts. Or better I found them but they are separate.
Go to the Keyboard shortcuts preferences :
Eclipse > Preferences > General > Keys
and unbind or rebind whatever is giving you trouble.
In your case, go to Inspect and remove the binding for Cmd+Shift+Z.
In some cases, removing the binding for a key command will remove all bindings for it so after you do so, check out Redo and make sure it is still tied to the command.

How to disable eclipse4 built-in keyboard shortcut?

Eclipse 4.2 seem has some built-in shortcuts, such as Ctrl+P, Alt+C, Alt+X etc, you can not find them from "Window->preferences->General->Keys". I'd like to re-define these shortcuts, e.g. bind Alt+X to run maven build, but when i press Alt+X, at the bottom right corner of Eclipse, it flashes quickly and my mouse is out of control, i think this is because of shortcut conflict.
Anyone who know how to disable the built-in shortcuts? Thanks.
Edit:
Ctrl+p is only bind to one action.
When i click Ctrl+p, the bottom right corner show, this message is from from eclipse:
Well, the above is the good situation--at least you can choose which action to run. for Alt+P, Alt+c you have no chance to choose, eclipse is flipping and you are out of control.
Are you certain there isn't something in your OS or another application that is handling those keyboard triggers? If you assign a keyboard shortcut in Eclipse's Preferences, it will indicate when there is a conflict; if you don't see that, then it's not an Eclipse shortcut.
I found the root cause of this problem, i import all my keys from Eclipse 3.7 to 4.2, most of them works, however some of them conflict but Eclipse fails to show the conflict shortcuts, Let's say, Ctrl+P, this is print shortcut for eclipse by default, in eclipse 3.7 i bind Ctrl+p to another command, after import, eclipse 4.2 shows just like 3.7(see above), however in fact it still has conflict even though it does not show the conflict. I think this might be an eclipse bug. I'm the one who use shortcut extensively. Hope this help others with migrating shortcuts.

Choose-Command popup in Eclipse

I would like to ask if there exists some functionality in eclipse where it's possible to choose all available commands, instead of having to remember all the shortcuts.
Something like the command palette in sublime text 2. Where you by pressing ctrl+shift+p (windows/linux) get an input popup box where all availble commands can be choosen.
Does such a feature exists for eclipse, or should I develop it by myself?
Thanks in advance.
I just bumped into this feature by accident but looking up to see if I figure how to get to it. it looked like it popped up when I started typing after having launched eclipse without focusing on any particular view... more to come as soon as I find out for sure.
EDIT: Apparently when you first launch Eclipse the focus is on the "Quick Action" search box on the top right of the tool bar and that's where you can start typing command names for it to list and let you pick in good Sublime Text style. Not sure how to shortcut into the box other than clicking it, but apparently there's the feature.
EDIT#2: http://www.vogella.com/tutorials/EclipseShortcuts/article.html#shortcuts_overview describes Ctrl+3 as being the shortcut to get there, on the Mac it translates to Cmd+3.
I haven't been able to find anything, so I have started on developing my own plugin.

How Do I Switch Between Multiple Eclipse Windows (in "Split Screen" Mode)

Eclipse allows you to open more than one text editing "window" at a time to get a "split screen" effect. This is great, but the problem I'm having is that there doesn't seem to be any way to switch between these windows, directly.
Now, you can use the usual commands (Ctrl+Page Down, CTRL+e, ALT+RIGHT, etc.) to switch between specific buffers. In other words, if I have window 1 with A.java and B.java open, and window 2 with C.java open, I can use Ctrl+Page Down to go from A, to B, to C. However, I can't just go from A or B (ie. from window 1) in to C (ie. to window 2), unless I use CTRL+e and type in "C.java".
There are half a million Eclipse commands though, and they're certainly not all labeled consistently, so it's quite possible I'm just failing to find the relevant command. Does anyone out there in SO-land happen to know it?
By default, its Ctrl+F6. However, its useful if you map you keys to Ctrl+Tab to switch between open editors like Windows.
You can change your preferred keys in Window>Preferences>General>Keys and change "Next Editor" to any key of your choice(Ex: Ctrl+Tab). Hope this is what you needed.
This can be achieved easily if you are using Vrapper in Eclipse. Vrapper
is a Vim plugin for Eclipse. If you are trying to maximize your productivity in Eclipse like we all are, it's well worth the try.
Once you got it installed, check out the Split Editor Plugin for Vrapper. You can then create splits on the fly and switch between them using the standard Vim shortcut: Ctrl-w w
Bonus: don't forget to maxmize your editors using Ctrl-m. If your editor ever loses focus for some reason, regain it by pressing Ctrl-F12
Finally open any file in your project using Ctrl-Shift-r
Edit from anula comment:
A useful thing to mention here: Ctrl-w by default binds to closing window, so if you want to use it as in Vim you need to first go to Window->Preferences->General->Keys and unbind "Close".
You can install the HandySplit plugin from Eclipse Marketplace and bind its 'Toggle focus between split editors' command to any keyboard shortcut you like.

Faster way (keyboard shortcuts?) to use quick fixes in Eclipse?

I often use the Eclipse feature (Galileo) of suggested error corrections to automatically create code stubs or to refactor things. For example, I would write a method that calls other methods which don't exist yet, then move the mouse over the error message and click on "create method". Or, change this to the class name and choose "add static modifier" from the quick fixes.
I think this is very convenient because it lets me stay in one place in my code and sort of "remotely" wire up what's not currently visible on my screen. What I think is annoying though, is that I have to leave the keyboard, hover my mouse over the error symbol, wait for the tooltip to pop up, and click on the option (doing that, I sometimes move the mouse a little over the edge and the tooltip goes away again - very annoying).
Am I missing a faster method here? I can't seem to find a keyboard shortcut, but then I have overlooked stuff from the huge preference dialog before.
Ctrl+1 : Quick Fix.
(Cmd+1 on Mac)
Just put your cursor on the part you suspect you can perform an action (correction, refactoring, ...) and hit the Quick Fix shortcut. The same popup will be displayed, and you can select the right option with the up and down keys.
That, combined with Ctrl+3 (Quick Access) gives you most of eclipse features at your fingertips ;)
See also:
Eclipse Tip: Shortcut to Quick Fix
My Favorite Eclipse Shortcut: Quick Fix
Eclipse hotkeys: eclipse shortcuts gold mine.
As an additional tip, a specific type of quick fix I use all the time has a dedicated shortcut:
Alt+Shift+J: Add Javadoc comment stub for current method.
After using ctrl+1 like mentioned in the top answer, press ctrl + enter to apply the selected fix all to problems of the same category.
In general, keyboard shortcuts in IDEs (and code tools in general) are coming from a user principle that holds that the more your hands/fingers can remain poised over the keyboard (as in the f-j centered "touch typist" position), the more productive you can become. This is probably why the use of the number keypad is not encouraged, or other keys, less common to the most basic layout keyboard, are not used. Many hold that useful keyboard shortcuts should be easily reachable from this position.
One thing I will say about eclipse keyboard shortcuts is that if you use a popular Windows presentation utility called Zoom-it, you need to turn that off when using eclipse. There are several show-stopper conflicts between the two, such as Ctrl-1 and Ctrl-3.