How do I map an external tool to a hotkey in Eclipse? - eclipse

In Eclipse, I have external tools defined in Eclipse that I execute regularly. I'd like to save me some time by wiring them to a hotkey. I've done some googling on this and most of the information I've found is from last decade. I'm also fully aware that I can wire a hot key to "Last executed external tool", but that last tool isn't always the same.
How do I wire an external tool defined in Eclipse to a hotkey?

I don't know if you can bind a key to this, but the PathTools eclipse plugin lets you register a set of custom command lines, which you can select from a menu. If you can bind a key to selecting it from a menu, then that works.

Maybe this could be helpful to you, http://www.eclipse.org/forums/index.php/t/88391/
Here you can possible get som help. Coute :" There currently is a command for running the last external tool
See Window>Preferences>Workbench>Keys
It is in the Run/Debug category; Run Last Launched External Tool
By default it is not mapped to a shortcut.
I have it mapped to F9"

I eventually landed on using AutoHotKey to define additional hotkeys to run external tools.

The way I do it:
In the common settings of the external tool, set the combo box of "Display in Favorites Menu - External Tools"
(optional): Organize favorites for a convenient number.
Whenever I want to invoke the tool:
press ALT (for menu bar),
then press r (for run),
then press e (for external tools),
then press the number of the favorite.
This can be done really fast. It's the closest thing to a hotkey. After 3 days you won't notice the difference...

Related

Shortcut for selecting run configuration in Eclipse IDE

I have an Eclipse workspace with a bunch of projects. I manually created some run configurations for each project (it's necessary to pass some arguments to VM, so I can't just run it directly, e.g. using shortcut ALT+SHIFT+X, T in the specific file).
Most of the time, I just use one run configuration (whereas for the first time I manually launch it using Run -> Run configurations -> (name) -> Run). Since I configured Eclipse to always run the last run configuration (on F11 or CTRL+F11), it's usually enough.
However, sometimes I need to switch to a different run configuration and then back to previous one and then to a different one etc. Is there a quick way to do it? I'd like to see a shortcut, which would display pop-up window with all existing run configurations. By typing first few letters, I'd find an appropriate one and would be able to immediately run it by pressing ENTER. I mean something similar to what CTRL+SHIFT+T or CTRL+SHIFT+R looks like.
I'm afraid there's not something like that. Nonetheless, any advice on how to get more effective would be greatly appreciated, because I'm bored of switching run configurations via menu (as I described above). I can press ALT+R, N and then select a run configuration using arrow keys, but it's not really that comfortable.
You already gave most of the answer yourself. Start by pressing ALT+R, N and then simply start typing the name of the configuration you want. The cursor should be positioned in the filter field and thus incrementally reduce the list of launch configurations as you type. When you've narrowed it down to 1, complete the selection by ALT+R.
BTW: thanks for the reminder, I, too, was using the mouse way too much in this particular use case. I will stop doing so, now that I gave the answer :)
Since Eclipse 4.12 (June 2019, 4 years later) you can also launch any of the Run or Debug configurations available in your workspace from... the Quick Access menu (Ctrl+3 shortcut)
Note: For performance reasons, the extra Quick Access entries are only visible if the org.eclipse.debug.ui bundle was already activated by some previous action in the workbench such as editing a launch configuration, or expanding the Run As... menus.

Eclipse Run As Groovy Script by Default

I'd like to run my Groovy project in Eclipse using a shortcut (CTRL+F11). The trouble is, every time I do so I get a "Select a way to run " dialog, which gives me the choice between Groovy Console, Groovy Script, Java Application.
I've already set a Run Configuration to use Groovy Script, and if I click that Run Configuration under the Run As menu, it just runs.
How can I get my project to execute from a keyboard shortcut without that dialog popping up? I can't imagine ever selecting one of the other options.
I've never been able to get a satisfactory keyboard shortcut for Groovy script runs out of ctrl-F11. Instead I use alt-shift-X and then press G when the menu appears.
For debugging I use alt-shift-D, then G.
Both are two-stroke, rather than one-stroke, solutions, but neither one forces me to use the mouse or the arrow keys.
Under Project>Properties>Java Build Path and then click on Java SE, what ever it may be, click finish.
On the off chance that you deleted your java system library you can o pick up a new one... http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Chrome console + text editor

I find myself typing JavaScript in the console a lot. For example, I quickly want to see the result if I change the property of a certain object. However every time that I refresh the page I have to redefine my variables, etc. I do this by using the up-key, so I do not have to retype, but this costs a lot of time. What is a better way?
The ultimate coolness would be an environment like Sublime Text in which you can write multi line code and from there execute it directly in the browser... And then still have the autocomplete list of all the methods of an object (like in the console). Obviously this is not available, but I am very interesting in the workflow of other when typing JavaScript code in the console.
In Chrome 24's Sources panel, use the Snippets tab. Right-click in the left (blank) tree and choose New from the context menu.

How I can organize run configuration in Eclipse?

In Eclipse, I have organize my favorite "run configurations" but I have a lot of favorite.
So I would like to know if a plugin exists that permit to create folders or sub-lists to have a better view and organization of my run configurations.
I would like this because when I click on the "arrow" near "Run" button on the top of the Eclipse toolbar I have a very long list and it's diffuclt to find quickly the "run configuration" that I want.
I hope somebody have an idea and can help me.
Thanks.
Sincerely,
Arnaud
There are some ways to help a little bit:
If you are more interested in the last started run configurations, these get a number. Number 1 is the last, number 2 the previous before and so on.
Press ALT-SHIFT-X followed by the type of run configuration (j for Java), and you get a list of run configurations. Type in the filter box, and select by cursor keys.
Under Run > Organize Favorites ... you have the option to mark some of them as the ones you want to use often. These will listed at the top of the selection list then.
Run configurations... > Filtering Preferences... will open the preferences where you are able to define which filter should be used for the run configurations. If you use Working Sets in your programming, this could be helpful, so by switching Working Set, the run configurations come with it.
I think the keyboard shortcut is the fastest one if you want to use the run configurations all. If there is a special order, the first tip by be sufficient. If your context changes, and the run configurations should change as well, use the working sets.
I'm a bit late, however it might help future readers.
Well, if you want to manage your Run Configurations I would recommend you Eclipse Runner plugin.
I hope that helps.
I don't know of any plugin that does that, but in Eclipse the chosen run configuration if you hit the run button is the last one ran. Which is what you'll need most of the time, typically. Otherwise you can just go inside the menu, where all configurations are grouped by type and choose from there, that might take a couple more seconds but maybe is not so confusing.
One way to do it is to save the run configurations as "Stored Files" in various project directories. This doesn't require saving or loading manually, you just select "Shared file" in the "Common" tab and set it to a project directory.
When you open or close one of these "Projects" (even if that project contains nothing but run configurations) it will show/hide those configurations.
I'm currently considering creating some "Fake" projects just to hold launcher groups.

Tying a single operation to multiple "when" situations in Eclipse. Is it possible?

I'm looking for a way to tie a certain keyboard shortcut to running an Ant Task in Eclipse.
I'd like to do this from any place in Eclipse. From what I've seen, I could define a hotkey for "Run the last external application", but that obliges me to define a "when", that is, a place I want to be when that hotkey makes sense.
I guess I'll want to run that either when I'm coding or when I have the package-explorer open but Eclipse only seems to allow me to define a "when". Is there a workaround for this?
Better yet, is it possible to define that a certain hotkey combination can be ran from anywhere in Eclipse?
It sounds like you want to use the "In Windows" entry for the "When". "In Windows" should make the shortcut work within any Eclipse window, but not in dialog boxes. If you want it to work in dialogs as well, then pick "In Dialogs and Windows".
Read more about shortcut definitions here. The section labeled "Contexts" corresponds to the "When" field of the Keys preference page.
Update: There is a bug in some versions of Eclipse that cause the key binding described above to open External Tools configuration dialog instead of running the last external tool. The linked bug report indicates that this bug has been fixed in the forthcoming version 3.7.