I would like to enhance Eclipse so that when I press a custom key combo--say Ctrl + Shift + E--then it will run a command on the current file (if my current buffer is foo.c then it will run `mycommand foo.c' in foo.c's directory).
Open the External Tools Configuration dialog from the Run menu. Create a new configuration with the following settings.
Location: c:\mycommand.exe (alter to your needs)
Working directory: ${container_loc}
Arguments: ${resource_loc}
Under Prefrences->General->Keys you can setup a shortcut for "Run last launched external tool".
This should solve your problem.
Also, make sure that your "resource" (foo.c) is selected. It happened to me that when testing the external tool and horizontally scrolling the output pane, the resource gets deselected. When you run the external tool again after probably having made changes to its configuration, Eclipse will pop up an error box about "empty variable" (e.g. ${resource_loc} ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With