Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

isearch across line breaks

Tags:

emacs

Is it possible to make isearch disregard line breaks, i.e. a search for foo bar will find

.......... foo
bar .....

I get bitten by isearch failing on such queries regularly when navigating long documents, and it's rather annoying. I am aware that word-search-forward finds matches across lines, but it has certain shortcomings (e.g. it forces you to use complete words, so a search for "foo b" will fail; it doesn't highlight search results), and, more importantly, it's a little silly to use a different command depending on whether you are searching for one word or two.

like image 645
Leo Alekseyev Avatar asked May 17 '11 09:05

Leo Alekseyev


1 Answers

Use C-M-s - isearch-forward-regexp. This will interpret space characters as a marker for any white space character.

like image 64
Teddy Avatar answered Sep 28 '22 04:09

Teddy