可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
In eclipse, is there a way, to reveal the currently selected file in the filesystem.
I currently need it to open in explorer, but it could also be in finder or nautilus.
Basically, I do not need the "Open with System Editor" option. I would like a right-click menu with the option: "Show file in explorer/finder/nautilus".
Thanks
回答1:
Note: You can also develop your own external tool to open the file in a Windows explorer
Or you can use an eclipse plugin like StartExplorer.
Notes on MacOS:
zvikico mentions:
On Mac OS X, replace the location with /usr/bin/open
and the arguments should be just ${container_loc}
.
But Adam cautions:
Doesn't work - OSX, you need to put quotes around the ${container_loc}
otherwise you'll often get bizarre error messages because it can't cope with spaces in file names.
But user2036022 details:
you can use -R "${resource_loc}" on macosx as argument to /usr/bin/open
to be consistent with other similar tools.
回答2:
ExploreFS
is a cross platform plugin and works fine on Ubuntu and Mac OSX.
- open "Install New Software" (from help menu in OSX),
- add
http://www.junginger.biz/eclipse/
,
- select ExploreFS from the checklist,
- choose appropriate options and install the extension.
Now you can click on your project, package or file and select Explore in File System and it will open the location in your default file manager.
回答3:
I've been recently using Eclipse Luna version, and it has that feature natively implemented, very nice!
In "Project Explorer" view, right click on the file you're interested in --> "Show In" --> "System Explorer"
回答4:
Open the Properties of the file (Right Click->Properties) and the dialog will give you the full filesystem path.
回答5:
Have a look at the PluginBox: http://pluginbox.sourceforge.net/plugins.html. This works with Linux as well. You can configure it precisely or choose a schema for Gnome, KDE, ...
回答6:
Try the EasyShell extension: http://marketplace.eclipse.org/content/easyshell
回答7:
Why don't you right click on your file and select "show in> system explorer" then you will find life is beautiful.
BTW, my eclipse version :Luna Service Release 1 (4.4.1)[for mac]
回答8:
Adding Show in Nautilus using External Tools is pretty easy too, very similar to the process for Windows in VonC's answer. Simply create the following shell script, chmod +x
it and add it to the PATH. Then use it in Eclipse's External Tools Configuration window, as shown in the screenshot below.
~/bin$ cat run-nautilus.sh
#!/bin/bash
nautilus `dirname $1`
回答9:
- @VonC has given the solution, but this solutions helps to understand more and put shortcut to the feature:
Explorer command line arguments
- /select [object] - selects the file or folder in the new explorer window
Directly we can not put shortcut to this feature, but setting shortcut to Last launched external Tool, we can put as follows:
回答10:
I cannot seem to comment, so I will post as an answer instead
On OSX the answer @zvikico is very close, I would change it to:
Location: /usr/bin/open
Arguments: -R ${container_loc}
The -R
argument is a reveal in finder argument, as opposed to actually trying to open the file.
Then you just Run As Shell as mentioned in the other external tool answers