Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

M-x occur-instant

Tags:

emacs

I like to do something equivalent to M-x occur in google-instant fashion. So as I type the regex, it will display all the matches. This would be little different compared to M-x iseaerch-forward-regexp, because the matches will be shown in different buffer, rather than same buffer.

Is there anything equivalent?

Thanks.

like image 772
aartist Avatar asked Sep 28 '10 15:09

aartist


3 Answers

Yes, check out ioccur.

Follow the links to the latest version, download the ioccur.el file to a directory where you put your Emacs packages (I use ~/emacs/lisp), and then add the following to your .emacs:

(add-to-list 'load-path "~/emacs/lisp")
(require 'ioccur)
like image 121
Trey Jackson Avatar answered Nov 19 '22 05:11

Trey Jackson


Another option: Anything

Provides M-x anything-occur

like image 22
Joseph Gay Avatar answered Nov 19 '22 03:11

Joseph Gay


C-' (command icicle-occur):

http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview

As with nearly everything in Icicles:

  • You can also multiple dynamic patterns, progressively narrowing down the matches. You can match use substring, regexp, and fuzzy matching. http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ProgressiveCompletion

  • You can use negative filtering: narrow down to a subset, then hit C-~ to subtract that subset from the previous, larger set of matches. http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ChippingAway

  • You can sort the occur hits, in various ways. That can help in terms of comparison and cycling (cycling respects the current sort order). http://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates

like image 25
Drew Avatar answered Nov 19 '22 05:11

Drew