I want to search in a directory which is outside my workspace.
Steps:
I open a file which is outside my workspace.
Now I want to search in the directory which contains this file.
I use "Reveal in Explorer" and try to use the breadcrumbs, but I see no way to search in the directory.
I use Go, but AFAIK this should not matter for this question.
As it happens another extension I wrote makes this pretty easy: Find and Transform.
It adds three context menu entries:
Search in this Folder
Search in this File
Search in the Results Files (if there has been a previous search with results)
You can right-click on any tab or editor body and select Search in this Folder and it will populate the files to include input box of a search with that file's parent folder path.
And if you have any text selected, the query field will be populated with that selection (even if it is just a cursor in a word).
You could also just right-click on that tab and chose Copy Path, paste that into the files to include input of a Search and then delete the last part of the path back to the folder.
Related
I constantly use Eclipse's find-in-file feature this way:
Search->File->File Search tab.
When I get a list of files containing my search string, these files shows in the bottom pane. When I click, in the bottom pane, the line in a file that contains the search string, the file is always opened in the same file editor tab, and so the file I opened earlier that contains the search string is gone. I am hoping to open several files at the same time that contain the search string.
Thanks for help!
On the Search preference page, uncheck the box for Reuse editors to show matches.
I remember once setting a shortcut to find a file and focus on it within Eclipse's Navigator view (or some other explorer view). It wasn't a pre-defined shortcut, but one I assigned to action I found in keyboard bindings.
Note this is not Find Resource (Ctrl+Shift+r) - I do not want to open the file, just focus on it in a navigator/explorer view so that I can perform operations on it (SVN, rename, etc).
If file is open then use
ALT+SHIFT+W+N
It will select file in navigator. If you want to select file in "Package Explorer" use
ALT+SHIFT+W+P
I usually use Ctrl+H. Does it solve your problem?
Ctrl+h ------> file search ------------> file name pattern (like index.jsp)
Search tab appears beside server tab.
You can perform all SVN operations on it. Hierarchy view appears with exact file name and extension.
This isn't what I remember, but it is close enough.
Find Resource (Control+Enter+R).
Search for the file.
At the bottom of the Open Resource dialog, select Show In > Project Explorer.
It lets me see/act upon a file in navigator/explorer view without opening the file, which is what I wanted.
I remember being able to do that in one action. Perhaps it was a long forgotten plugin.
I want to compare two files. One is in the current project and the other is in the backup directory. I know how to compare if they were in the same project.
How can I compare in Eclipse?
And what is Flex navigator in Eclipse?
Open the Navigator with the Main menu: Window->Show View->Navigator.
You can select two or more files in the Navigator using Ctrl-click, or Command-click in OSX. Now Right-click any one of the selected files, and select the menu item: Compare With->Each Other.
The problem is that your alternate file might not be in the Navigator, e.g. your backup directory isn't listed in the Navigator. If not, Right-click in the Navigator and choose the menu item: New->Folder. In the resulting dialog click the Advanced>> button beneath the Folder Name field, choose Link to alternate location (Linked Folder), and browse to add your backup directory.
Now using the Navigator you'll be able to select the two files, and use Compare With.
You can similarly compare files using e.g. the Package Explorer.
I just want to copy list of files displayed in eclipse search tab,
When i try using right click copy and paste into some folder it does not work.It actually copies the file location rather than the file itself
There is no direct way to do this. What you can do is:
Double click on the entry in the search tab
F12 to switch to the editor
Ctrl+Alt+W to select the file in the navigator view
Drag the file from there to the place where you want it
Too tedious? Then open a command prompt or shell and use the file location there.
If you need file locations then use Eclipse search csv export plugin.
If want to copy the whole file(s) into a folder then refer #Aaron Digulla answer(Its applicable to single file). In case of multiple files. Press Ctrl + A to select all search results in search view. Right click on the selection. Choose Show In > Package Explorer. Drag file(s) to a folder in any file explorer.
If I've got a file open in Eclipse, how can I figure out where it is on the filesystem?
For example, in Vim I would use :pwd.
Use the Eclipse menu:
File->Properties
or the shortcut:
Alt-Enter
You should be able to see the Location associated with the Resource
Just hit Alt-Enter.
The other solution ("File-->Properties" or "Alt+Enter") didn't work for me.
I use:
Right Click (in current editor) --> Show In (shortcut: Alt+Shift+W) --> Project Explorer
This shows in Project Explorer the location of the file. If the file is a class in a referenced library, the dependency tree is automatically opened.
What you're looking for is the 'Properties' dialogue for the current file. This can be activated in two ways:
Selecting from the menu: File -> Properties
Using the shortcut: Alt + Enter
This gives you a dialogue which contains both the full path of the document, as well as the relative path from the workspace root.
The dialogue can be quite handy: it allows you to highlight and copy the file path.
Linking to Project Explorer won't work if you have many files - it will select the right file in the list, but it won't "scroll" to that portion so it is visible.
You'd have to manual scroll the Project Explorer view to see where the file is. It could also be nested so deeply that the full location will be obscured by truncation.
Another way to quickly (keyboard-free) see the path is to hover over the file type icon (on top of the open editor window).
Eclipse also has the ability to link the explorer view with the current file, so that whenever you change a file, it is expanded and selected in the explorer view.
Just look for the following image at the top of the view: