How to enable “live search” in eclipse?

十年热恋 提交于 2019-12-10 12:37:03

问题


In Komodo Edit, an input field is available in the toolbar. When I type text in it, it highlights matching search results. Is there something like this in Eclipse, either directly or via a plugin?


回答1:


As TK Gospodinov has already mentioned, there is an Incremental option in Find/Replace (Ctrl+F) dialog.

There is also a special key binding for Incremental search in Eclipse (and personally I use it more frequently). From Eclipse Tips and Tricks:

Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.




回答2:


If you'd like to have search functionality in a toolbar, you may be interested in the eclipse-glance plugin, which allows you to use the incremental search function in a toolbar by pressing Ctrl + Alt + F while in any text area.




回答3:


This feature is already available in eclipse. No need to install any plug-in. Press Ctrl+F, and the Find pop up appears.

Now check the incremental checkbox, and then your texts will be found as you type. No need to hit return.

OR

Use Ctrl+J and you can activate the live search, just that there wont be any UI visible, but you can see the status in eclipse status bar at the bottom.

Press Ctrl+J, start typing the text you want to search for. Press esc to go back to edit mode




回答4:


The closest thing to the functionality you are asking about is the 'incremental search' mode, which is triggered by checking the 'Incremental' checkbox in the Options group on the Find/Replace dialog in Eclipse (Ctrl+F from the code editor). This will make it start highlighting matches as you type, and if they are keywords, Eclipse will highlight other occurrences (references) in the code editor. Matches inside strings or Javadoc will not be highlighted, however, unless it happens to be the first match after your cursor's position inside the editor.




回答5:


One similar thing (not the same) is just enabling "mark occurences", then selecting function name, variable etc.



来源:https://stackoverflow.com/questions/7710725/how-to-enable-live-search-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!