Is there a shortcut to copy the current path/file to the clipboard?
Find the file or folder whose path you'd like to copy in File Explorer. Hold down Shift on your keyboard and right-click on it. In the context menu that pops up, select “Copy As Path.”
There is Copy Qualified Name
function in Eclipse, it will copy the full name of the element you select (or element on cursor).
For example :
/MyProject/src/app/Application.java
: when you select Application.java in Package Explorer
java.util.HashSet<String>
: when you copy while cursor at HashSet<String>
However, it required you to select the element you want.
So, here is what I do.
Make your Package Explorer
link with editor, you can active this by click the double-arrow icon at top-right corner.
Set up a hot-key for Show View (Package Explorer)
ex : Alt + 1
Set up a hot-key for Copy Qualified Name
ex : Alt + Ctrl + Shift + c
Whenever I need these information in current file, I just press the hot-key to call my Package Explorer
Since it links with editor and will always select the file in current editor, you can just copy with the hot-key. Then you can use F12 back to your editor, or simply ESC if you use fast view.
Not perfect, but it works :D
There is yet another plugin that supports copying the path along with a number of other related functions:
http://code.google.com/p/pathtools/
Just search Eclipse Marketplace within Eclipse for 'pathtools'.
You can do it with a single keystroke by configuring an Eclipse external tool (a much underused tool in my opinion). Takes about a minute to configure the first time you use it but then it's always available. Here's a YouTube video demonstrating the technique.
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