How can I make Emacs isearch faster?

393 Views Asked by At

I use isearch all the time in Emacs but I've noticed on large org mode files it can take some time to find the first match. Is there any way to speed up isearch in a buffer?

EDIT: The most noticeable speed improvement came from setting isearch-lazy-highlight to nil. I was experiencing a noticeable delay when calling isearch to jump to text and this delay has now disappeared.

2

There are 2 best solutions below

4
On BEST ANSWER

One thing to keep in mind is that the longer your search pattern the quicker the search. So quickly typing a long search pattern (or even entering one by using M-e) can help if the buffer is humongous.

Another thing you can do is to turn off option isearch-lazy-highlight, so you don't make Isearch find and highlight all of the matches in the currently visible text. See also options lazy-highlight-initial-delay and lazy-highlight-interval.

More generally, consult the Isearch doc.

0
On

If you were to Narrow the buffer to only the section(s) of interest before searching, then the search would be faster.

Whether this represents an overall time-saving or time-loss no doubt depends upon your use-cases.