is the incremental search facility that highlights matching text as characters are typed. isearch-forward and isearch-backward support searching characters, strings, and regexp.
Questions tagged [isearch]
153 questions
13
votes
1 answer
Search for string ignoring new lines
I am used to writing files where paragraphs are split into several lines, e.g. with fill-column. When I search for a string (C-s) such as this is a long text, the search results would not return the locations where the string appears with a line…

Tony
- 231
- 1
- 4
12
votes
2 answers
Make isearch skip folded content in org-mode
Q: How can I tell isearch to ignore the contents of folded blocks by default in org-mode buffers?
More specifically, I'd like isearch to ignore contents of comment blocks and drawers: When authoring documents in org-mode I often use comment blocks…

itsjeyd
- 14,586
- 3
- 58
- 87
12
votes
1 answer
Delete portion of Isearch string that does not match, or last char if complete match
I have the following
(defun isearch-del-fail-or-char ()
"Delete failed isearch text, or if there is none, a single character."
(interactive)
(if (isearch-fail-pos)
(delete-region (isearch-fail-pos) (point))
…

asmeurer
- 1,552
- 12
- 30
10
votes
1 answer
How to search an Arabic word in text without its diacritics/accents?
In Arabic as with some other languages there is what is called diacritics to enhance pronunciation. There is no convention on how many diacritics should be written for a single word. Some use the minimum (which I prefer) just enough to disambiguate…

doctorate
- 1,789
- 16
- 39
9
votes
2 answers
Selecting (i.e., as the region) the current match in incremental search
When searching for a string with C-s, I want to be able to hit some key to exit search mode but still maintain the selection of the match. That way I can immediately start typing and replace the last match.
For example, say I have the following…

Ben
- 587
- 4
- 11
8
votes
1 answer
Can occur display just the matched part?
Or is there an alternative tool (perhaps some option to isearch?) that would show just the matches in a separate buffer linked to the original buffer?
Use-case
I have a log file with very long lines. When the matching line appears in *occur* buffer,…

wvxvw
- 11,222
- 2
- 30
- 55
8
votes
2 answers
How can I match "snake_case" automatically when I search for "snake-case" by mistake?
I frequently mistype "_" as "-" when doing a quick isearch-forward.
E.g. I'm looking for snake_case and accidentally type C-s snake-case and get no results. Best case I notice quickly enough and don't have to delete too much of the search term,…

Tom
- 181
- 3
7
votes
1 answer
edit search string and begin search from current location
I use C-s to start an incremental search. Sometimes I want to change the search string and either restart the search entirely from the beginning of the document or (other times) just change the search string and proceed from current location. How…

Alex
- 173
- 3
7
votes
1 answer
char-fold-search match for German eszett (ß)?
In emacs 25.1, if I customize search-default-mode to "Char-Fold Search", then an isearch-forward for
u matches ü
and one for
o matches ö.
But what character should I type to match ß ?

glmorous
- 81
- 3
7
votes
2 answers
When searching, how to always ensure that a few lines after the highlighted word are visible?
When performing search/isearch in a text, sometimes it would be desirable to see a few lines after the highlighted searched string, it other words to avoid that the highlighted word to be at the bottom of the window.
For example if we have the…

Name
- 7,689
- 4
- 38
- 84
7
votes
2 answers
When to use normal incremental search in place of the regex version?
Assuming familiarity with regex, is there ever any reason to use the normal incremental search (C-s) over regex (C-M-s)?

Jessie
- 317
- 1
- 6
6
votes
3 answers
Get Emacs to jump to the start of a word after isearch
If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in acCommodating. This strikes me as rather unintuitive because…

Edman
- 1,167
- 7
- 13
6
votes
1 answer
how to customize the secondary highlighting in searches
When I search for text in my buffer, the cursor moves to the first occurrence but all occurrences beyond the first are also lit. E.g. "jumped" in the screenshot below:
Unfortunately, this particular color for the "other" occurrences is very similar…

Marcus Junius Brutus
- 643
- 4
- 13
6
votes
2 answers
How to search/isearch just comments?
Is it possible to perform a search/isearch just in comment regions of the text?

Name
- 7,689
- 4
- 38
- 84
5
votes
1 answer
Use thing-at-point for isearch and minibuffer commands
How can I insert some text (thing) at point from the buffer into the minibuffer at a text prompt or during an incremental search? Is there a convenient way to insert, e.g., the sexp around point?

Netsu
- 555
- 1
- 5
- 9