How can I get Eclipse File Search to skip certain files? - eclipse

In my Eclipse project, I have a mixture of java files, xml, and various files with different file extensions. I want to perform searches on a regular basis on everything except for the java files, to look for certain settings.
Is there a way to tell Eclipse to search all the files, EXCEPT the one's with a .java extension?

The best thing you can do inside the file search dialog is to press the button "Choose" for the "File name patterns", then press "select all" and deselect "*.java".
But beware! This doesn't look for all file extensions in your project and lists them. It's a predefined set of extensions.

Yes, in your file search dialog, there is a "Choose" button next to the "file name patterns" textbox. It allows you to filter Select Types. After selection, you should just realize it is just regex of everything except for *.java.

Related

Matlab: Search everywhere shortcut

Is there any shortcut in Matlab comparable to Search Everywhere in the JetBrains universe or Control-P in Sublime?
A shortcut that searches for files/ folder/ functions etc. in the current directory and makes it possible to switch there by pressing enter?
I think this is what you are looking for: Find Files and Folders. And you probably want to use the advanced features:
To conduct an advanced search for files, you can use the Find Files
tool. Use the Find Files tool to:
Search for specific text in file names and within files
Include or exclude specified file types from your search
Search in specified folders
Exclude large files from your search
To open the Find Files tool, on the Home tab, in the File section,
click Find Files. Enter your search criteria in the dialog box that
opens.
The keyboard shortcut shoud be CTRL+SHIFT+F but I'm not sure.

Eclipse - Highlighting same word occurrence of random extension file

Is there any option to make Eclipse highlight same occurrence of word in random extension file?
Eclipse works for known file types (.java, .php, py...), and it matches and highlights same occurrence but it won't match same words in random file types i.e. extension of .abcxyz?
According to the official Eclipse documentation:
To associate editors with various file types in the Workbench:
Open the command link General > Editors > File Associations
preference page.
Select the file type from the File types list, or
click Add to add a type that is not already on the list.
In the Associated editors list, select the editor that you want to
associate with that file type. To add an editor to the list:
a. Click Add. The Editor Selection dialog box opens.
b. Select Internal Editors or External Programs, depending on whether the editor that you want was built for the Workbench or runs
outside the Workbench.
c. If you select External Programs, you can click the Browse button to browse the file system.
d. Select the editor from the list and click OK.
Click on OK to finish associating the editor with the selected file type.
After doing this, Eclipse will be able to properly open files with any custom extension. The tricky part is the highlight thing, i.e., "how to highlight same occurrence of word". For that, you might need to create your custom syntax highlighting rules. According to this question and answer:
The Eclipse framework uses a fairly complex document model to do
syntax coloring (they call it coloring, not highlighting), it is not
as simple as it is in other editors.
If you really want to try and mess with it, you may want to read the
following from the Eclipse plug-in developer guide.
(The above link is now dead. This may be a similar document or this.)

How to make Eclipse ignore some files during lookup?

In Eclipse, there is the option to lookup a specific file by going to Navigate > Open Resource. Once the popup open, you can type to search for a file in the project. Is there any way to make this lookup ignore some files and not show them?
This is only possible to do by "inclusion" (that is, telling Eclipse which files to include during the search), not by "exclusion" (telling Eclipse which files to exclude).
In the "Open Resource" dialog, notice that there's a small down-pointing arrow at the top right. From there, you can select the Working Set which will be considered during the search. You can define the working set as the collection of resources to consider during search; only resources that are contained within the working set will be shown.

In Eclipse, is there a way to open a file by typing its path and name?

IDEs are wonderful for many things. But I dislike how they make me use a GUI for something I can do faster typing in a command line. For example, opening a known specific file. If I know the name of a file, from the command line I can just type the name of my editor and the filename. With tab-completion I can accomplish this very quickly in a reliable amount of time. No searching through output or moving my fingers off the keyboard.
Is there a way in Eclipse to open a known file simply by typing its path+filename? Maybe through a plugin?
The "Open Resource" shortcut (ctrl-shift-R) is almost it, but it only lets you type the name of the file, not the path. If you have several files of the same name in different directories, you must again hunt with the mouse for what you want.
Actually, if you are using Helios (Eclipse 3.6) you can use paths; for details, see "New features in Open Resource dialog" in that version's "New and Noteworthy" page.
Also, you can Tab to the list of results and use the arrows to pick the right one.
Well, there's the general File>Open option which is meant for opening arbitrary, but I don't know what that does if you point it to a file inside your workspace. This opens your normal platform open dialog which you might be more comfortable using quickly.
I think Open Resource is the closest you're going to get. You shouldn't have more than a couple of files with the same name, I would think, plus you can use wildcards to open files quickly. Also, remember that files you open more recently appear higher up the list of matches so you may find that the file you want is at/near the top of the list already.
In the "Open File" dialog, if you just start typing or paste from clipboard by Ctrl+V, the desired file will be selected.
The dialog before typing something:
The dialog after pasting the file location:
I'm using Neon.3 Release (4.6.3).

searching in eclipse

how can I search something in all files in a given folder in eclipse
also how can I search up, it's seems like only going down the document
sometimes I am working on single files, so there is no project defined. I know about the search in project feature
If you go to Search>Files... you'll have an advanced search dialogue where you amongst others can specify the scope to search in (all of the workspace, selected resources only etc.). Is this what you're looking for?
And also, if searching through a single file (+), you have the standard search dialogue where you can specify search direction to either forward or backward.
Search forward in file: Edit -> Incremental Find Next
Search backward in file: Edit -> Incremental Find Previous
Search in multiple files: Search -> File -> Containing Text.
Search files in a specific subdirectory: Select the sub-directory -> Search -> File -> Scope: Selected resources.
I reccomend that you learn the short-cuts for these tasks. (Key-combination is found right beside the menu-item.)
When you are searching "Java Resources" with "File Search" with "Selected resources" checkbox checked - you will not get any results.
To search recursively a chosen folder for any files:
Select folder (it has to be folder)
Select FileSearch with "Selected resources" checked.
Good luck
Use the Remote Search Feature. Here you can browse for local folders. Some stupid name...
If default eclipse search is not sufficient for your needs, eclipse instasearch plugin is a very useful plugin for search needs inside eclipse.
It is based on lucene. This is also available in eclipse marketplace.
It has extensive feature set.
Instantly shows search results
Shows a preview using relevant lines
Periodically updates the index
Matches partial words (e.g. case in CamelCase)
Opens and highlights matches in files
Searches JAR source attachments
Supports filtering by extension/project/working set
If you want to search for anything without telling Eclipse what it is, use ctrl+shift+L (QuickEclipseSearch). This is the quickest way.
You can also use 'file search' (press ctrl+H) and navigate into file search using left and right arrrows on the top right corner of your windows. Or type 'file search' in the 'Quick Access' window.
If you are looking for a specific method, package, field,type or constructor use JAVA search.
If you want search in a particular file then just press ctr+F and type whatever you want to search in that current file.
Read all the answers above but couldn't figure out the solution working for me. Finally gave a thought process keeping in mind all the solutions provided here and voila it worked for what I'm looking here. Thanks stackoverflow, this site is awesome.
Solution I worked out:
Goto Navigator window in eclipse, select the folder where you want to perform the search operation, now click Alt a & f (shortcut) which opens the file search window. Now select the option "Selected resources" in 'scope' section and hit 'Search' button.
In MAC I use, control+H (^H), it opens a window, where you can search for any text within all the files.