pbreault
pbreault

Reputation: 14496

In eclipse, reveal current file in filesystem

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

Upvotes: 46

Views: 13736

Answers (11)

Gabriel Staples
Gabriel Staples

Reputation: 52697

How to use the EasyShell plugin in Eclipse to quickly jump to, find, or copy the path of a file or folder

Use the EasyShell plugin. I love it--it's really great for this!

Install it, then right-click on the project in the Project Explorer and go to Easy Shell --> "Open with Default Application", "Copy full path to clipboard", or "Copy qualified name to clipboard":

enter image description here

Choosing "Copy Full Path..." might copy this path:

/home/gabriel/Downloads/Install_Files/Arduino/arduino-1.8.12/libraries/Mouse/src/Mouse.cpp

while "Copy Qualified Name" might copy this, which starts with the Eclipse project name as the root of the path:

/arduino-1.8.12/libraries/Mouse/src/Mouse.cpp

Choosing "Open with default Application" will open the file or folder in your default file manager, such as Windows Explorer in Windows, or Nautilus or Nemo in Linux.

Going further

  1. Ubuntu's default file manager is Nautilus, but I really hate that file manager, so I upgraded mine to Nemo on all of my Linux machines, as I explain here: How to install Nemo and set it as the default file manager in Ubuntu 18.04, 20.04, etc.. Jump to the end of my answer in the section titled "Why use nemo over Ubuntu's default nautilus file manager?" to see screenshots and why I love nemo so much more. I actually ended up moving from Windows to Linux finally on all my machines, even for my kids, in part because of the beauty and utility and time-saving and ease-of-use offered by the nemo file manager. Furthermore, MacOS's horrific and cumbersome file manager is one of the reason's I can't switch to Mac.
  2. I have documented other Eclipse plugins I really like in my document here, under the section "Plugins to Install": Eclipse setup instructions on a new Linux (or other OS) computer: Plugins to Install

Upvotes: 0

Premraj
Premraj

Reputation: 74581

  • @VonC has given the solution, but this solutions helps to understand more and put shortcut to the feature:

enter image description here

enter image description here

  • 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:
    enter image description here

Upvotes: 1

steven
steven

Reputation: 560

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]

Upvotes: 2

Osmar
Osmar

Reputation: 557

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"

enter image description here

Upvotes: 10

sigint
sigint

Reputation: 1882

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`

Set up the external tools configuration as shown here

Upvotes: 1

TomC
TomC

Reputation: 139

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

Upvotes: 0

Sufian
Sufian

Reputation: 6555

ExploreFS is a cross platform plugin and works fine on Ubuntu and Mac OSX.

  1. open "Install New Software" (from help menu in OSX),
  2. add http://www.junginger.biz/eclipse/,
  3. select ExploreFS from the checklist,
  4. 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.

screenshot

Upvotes: 15

VonC
VonC

Reputation: 1324347

Note: You can also develop your own external tool to open the file in a Windows explorer

alt text

Or you can use an eclipse plugin like StartExplorer.

alt text


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.

Upvotes: 51

Mr. Lance E Sloan
Mr. Lance E Sloan

Reputation: 3387

Try the EasyShell extension: http://marketplace.eclipse.org/content/easyshell

Upvotes: 4

robsch
robsch

Reputation: 9728

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, ...

Upvotes: 4

Adam Batkin
Adam Batkin

Reputation: 52994

Open the Properties of the file (Right Click->Properties) and the dialog will give you the full filesystem path.

Upvotes: 5

Related Questions