String search: has Eclipse IDE got a modern "find" UI (a la Firefox) - eclipse

One thing really really annoys me about the Eclipse ide: its find UI is so old style.
I would much prefer something like Firefox or Safari, that doesn't clutter my screen real estate with a useless window.
(source: eclipse-blog.org)

Press ctrl+j. Is that what you want?
Hold down shift to go backwards.

you can also select the word you want to search and use ctrl+K, use shift to go backwards.

And, if Eclipse's incremental search is not enough, you could always use a plugin like Glance.From their site:
Glance is an Eclipse plug-in providing extensible useful incremental text search in Eclipse. This plug-in supports the following features:
highlight all found matches
background search which never blocks text box
search in tables and trees
update matches when target content changed
new text containers can be supported through extension points
a lot of search settings

You mean, like... Ctrl+F, and then Ctrl+K?
You don't have to use the Search menu.
On the other hand, if you just don't like the popup dialog, I think you're SOL for now.

The Eclipse "find" dialog does more than "find" on browsers you mentioned (e.g. search-and-replace, etc.) Having more options means more real estate to control them.

Related

Eclipse (Squish) add custom annotation types

Hay, has anybody experiences with adding custom annotation types or appearance color options to the eclipse squish IDE? I'm trying to find a way to highlight previously verbalized words in the editor (i.e. **markme_**something(parameter). Sadly I can't find any plugins and as far as I noticed squish is doing a good job to hamper any kinds of external not former installed or in the manual mentioned plugins.
Another of my thoughts are to write an addition to the syntax checker but that would be probably kinda over the top and not that easy to realize. The source code is written in python.
Greetings and thanks!
Eduard
To mark a search string in the editor you can use Search > Search... (Ctrl+H). Then just enter the search string and press Enter. (While this will open and populate the "Search" view, the search string occurrences are being marked in the editor anyway.)
Perhaps you are trying to let the script editor color (a customizable set of) substrings in a customizable way? I have not found an Eclipse plug-in that would achieve that. The closest I could find (and available in source code form) is Highlight On Selection.
PS: Note that custom plug-ins are not supported in the Squish IDE, but that you can use the Eclipse IDE Integration, and then install the desired plug-ins into this Eclipse installation.

How do you make Eclipse not edit all the occurrences found by "Find Next"?

When I use Cmd+K to go to the next occurrence of the selected word, Eclipse leaves behind these red "cursors" right before the copies of the word that I navigate through. If I then edit the last occurrence that I find, Eclipse "helpfully" edits all the occurrences that I've navigated through in the same way. This leaves corruption in parts of my file that I'm not currently looking at, which is really infuriating.
I want to disable this "feature", but I haven't got a clue what to call it, so I don't know how to find the setting that turns it off. Searching the Eclipse preferences for "occurrence" only gives various versions of "Mark Occurrences" for each editor plugin, which doesn't disable this behavior when unchecked.
EDIT: Here's a video displaying the behavior I'm talking about: https://youtu.be/8xeKRLyGSLg
This isn't really given by PyDev, it's a feature added by LiClipse (http://www.liclipse.com/multi_edition_video.html).
After the link is done with Ctrl+K, you can press ESC to remove those links if you don't want the multi-edition to happen (so that when you edit one occurrence you don't edit the others).
I must say this is the first request to have that turned off... I'm pretty certain as I just took a look and there's no setting to do that -- so, unfortunately, until the next release, you have to either live with it, remembering to press ESC if you don't want the multi edition to happen or use a plain Eclipse install with PyDev, but you'd also be without other LiClipse benefits, such as textmate bundles, vertical indent guides, theming integration, etc.
Still, note that ideally, I'd say you should get used to it as it can be a real time-saver -- although I'll implement the setting to turn it off for the next release anyways, as it's something that should really be there ;)

Eclipse highlighting the same occurrence of the word

In Notepad++, it has a very nice feature that if I select a word, it will highlight all the same words throughout the text. I can also set the hot-keys to highlight up to five different words with different styles (See the effect below) .
Is there any ways to get this similar effect in eclipse? I know when editing Java, it will highlight all the same variables, but it will not work when I highlight the comments and editing other files type (e.g. xml, html, js, css and etc).
I've been working with Eclipse for quite a while and I'm pretty certain that there is no canonical way of doing this.
In Eclipse these things are managed on a per-editor basis and the Java editor does not support what your looking for for all I know. At least for the Java editor you can do some minor configuration in what is highlighted and how (Preferences > Java > Editor > Mark Occurrences), but I guess you already know that.
As for plugins, I'm not aware of any plugin that achieves what you're looking for. As a matter of fact I'd be surprised if there really was a plugin which achieves what you're looking for.
If something comes up I'd much appreciate you sharing it here, I've been trying to get decent highlighting into Eclipse for years unsuccessfully... :)
Here is a plugin for eclipse: http://ystrot.github.io/glance/
It highlights all occurrences as with notepad++ upon hitting Ctrl + Alt + F.
Below is what I found works for me but you can also assign a key shortcut to 'Find Text in File':
Select the word or section of text
Press CTR+3 to activate 'Quick Access' search
Type 'Find Text in File'
Execute
As mentioned by #Kislingk you can modify how the words are highlighted/marked in 'Preferences > General >Editors>Text Editors > Annotations'.
Here is the closest solution I have found:
Create a shortcut in Preferences/General/Keys
type in the search field: "Find Text in File"
By default it has nothing assigned so just assign your key binding to it.
Annotations can help with displaying it in the sidebar
If you enable "Mark Occurrences" (Alt + Shift + O), then all words that are the same as the one you have marked will be highlighted.
Well if you're searching in the currently open file only (via CTRL-F) then no, you can't have everything highlighted.
However if you use the advanced search (CTRL-H, then go to "File search" tab) there you can input the search pattern, as well as the file-name pattern for the file(s) where it should search, and when the search is done, the search terms are highlighted in each file where they were found:
Use file search to search selected resource can highlight same word in single file.
Another useful eclipse plugin is eclipse instasearch. It has extensive feature set. This is also available in eclipse marketplace.
There are other options needed to enable.(Preferences > General >Editors>Text Editors > Annotations). Find Occurrences and WriteOccurrences and enable Text as 'Hightlight'
Have tried all of the above answer, but all not working. At the end, i found that it's due to i have accidentally remove some of the JRE System Library, after add back, it's work correctly
Window > Preferences > Java > Editor > Mark Occurrences

How to replace Eclipse search dialog?

Is it possible to replace Eclipse search dialog to something more convenient, like the search dialog in Firefox or Chrome? The default one doesn't support F3 to search for the next match, it doesn't move itself away if the match is underneath the box and doesn't allow to highlight all the matches - and these are the features I really miss...
I don't think you can replace the Find dialog easily. You would probable need to (re-)write parts of Eclipse. Definitely doable, but not a small task...
That said, most of your problems can probably be addressed by the current dialog:
The default one doesn't support F3 to search for the next match
"search next match" is Ctrl-K by default. You can configure the keybindings under "Preferences / General / Keys": change the keybinding for "Find Next".
it doesn't move itself away if the match is underneath the box
Yes, that would be nifty. The dialog does however remember where you last put it, so just put it somewhere out of the way (e.g. over the package browser, or to the right), and it will stay there.
and doesn't allow to highlight all the matches
This is not yet available (though it has been discussed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692 ). There are however two ways of getting a similar result:
Use the search function from the toolbar ("File Search" from the "torch" button). If you search there, it will highlight all matches in the editor (and provide marks in the editor ruler, and a list in the search view).
For Java elements, activate "Mark Occurences" ("highlight pen" button). This will highlight all occurences of a Java element if you mark in in the editor.
Maybe one of these will help you.
Finally, you can just open any file in an external editor (like (g)vim or Notepad++) right from inside Eclipse (right-click -> Open with). Then you can use any editor you want...
While it may not be exactely what you want, have you ever used the incremental search (Ctrl + J)? In my opinion it is much more convenient than the standard search.
A newer alternative is InstaSearch.
Information:
InstaSearch is an Eclipse plug-in for doing fast text search in the workspace. The search is performed instantly as-you-type and resulting files are displayed in an Eclipse view. It is a lightweight plug-in based on Apache Lucene search engine.
Each file then can be previewed using few most matching and relevant lines. A double-click on the match leads to the matching line in the file.
The "search the next match" is Ctrl-K. Previous is also available, see the "Edit" menu...
Only the highlight feature does not seem to be present. You might need a plugin for that (everythinhg is possible with plugins).
There was a Summer of Code project to implement a Firefox like search in Eclipse in 2007.
This is the official page, and this Blog shows a promising screenshot.
I never tried to install it, and I didn't find a final release or something though :(
SearchTab is an Eclipse plugin that shows a Firefox-like search tab
You do this by changing the key bindings under Preferences -> General -> Keys

Is it possible to work in Eclipse with keyboard only?

as most of us surely do every now and then, I try to improve my workflow. As Eclipse is my main IDE, I wondered if it may be possible to use it without mouse. I browsed the available shortcuts and tried to use them instead of my mouse. I found interesting features like Ctrl+3 which opens something like the Apple spotlight.
I know there are a lot of questions concerning favorite shortcuts etc. but I'd like to know if it works because at the moment it feels a bit squishy 100% without mouse.
So is anyone out there using Eclipse like that? And are there some hints to ease the change?
Yes, it is possible. For a start, check out 10 Eclipse navigation shortcuts every java programmer should know. When you use these 10 shortcuts and some of the shortcuts of the comments, you will already see a big performance boost.
The "open type" and "open resource" dialogs are CamelCase-sensitive, so when typing "NPE" in the open type dialog, I get two matching items NoPermissionException and NullPointerException. So using good names with consistent spelling is a must.
Ctrl+F11 starts a program, F11 debugs it. Note howewer to check if in Window-Preferences-Run/Debug-Launching the value of "Launch Operation" is set to your needs.
You may want to customize the search dialog (Ctrl+h) to only show the file search (default is to context sensitively present you with different search tabs).
Ctrl+n allows you to create something new (opens a wizard with an initial filter text to filter the possible next pages).
I'm a blind programmer who uses eclipse. While there are plenty of shortcuts I find people often overlook using menus from the keyboard. If there's a function you use a lot that doesn't appear to be supported with keyboard shortcuts you can either create a shortcut to it in prefferences or use keyboard shortcuts such as alt+f to access the file menu and a one letter combination that allows you to access the item. For example hit alt+f then a to access the save as dialog. The underlined letter is the one you want to hit once in the menu.
There are a couple of things you can do to improve your keyboard:mouse usage ratio with Eclipse.
First off, if you push Ctrl-Shift-L, it shows you a master list of all the shortcuts you can use. If you know what you want to do, this is usually a quicker way of doing it without having to dig through menus, and as a bonus, you will learn some shortcuts you didn't know before.
The other thing you can try is a plugin called MouseFeed which looks promising. It tells you the shortcut for any menu item you use and if there isn't one, reminds you to create one. It essentially acts as training wheels until you become as close to 100% keyboard use as possible. I'm not sure how well it works in 3.4, but you can give it a shot.
Hope that helps.
Here you get an Eclipse Shortcut Overview PDF file of all key bindings. This file you can print and put beside your keyboard if you wish.