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]
158 questions
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
4
votes
1 answer
How to use backspace to erase last character in search string?
When I am using incremental search, a backspace erases the character from the matched string in the buffer, instead of erasing the character from the search string I am typing. I saw that this is not the case with another emacs user... is there…

deejay
- 193
- 7
3
votes
2 answers
Repeat last isearch with all parameters
Everyone knows you can repeat the last I-search with C-s C-s, but that doesn't preserve all the parameters from the last search. As a concrete example, I often use symbol I-search (M-s _), and typing M-s _ C-s is a fair bit cumbersome when going…

Dolda2000
- 133
- 3
3
votes
1 answer
Wraparound search with `isearch-mode`
I found this function in this site:
(defun search-selection (beg end)
"search for selected text"
(interactive "r")
(let ((selection (buffer-substring-no-properties beg end)))
(deactivate-mark)
(isearch-mode t nil nil nil)
…

aarkerio
- 132
- 5
3
votes
1 answer
isearch, but not past the nth line of the buffer
I'm doing an Isearch on a large file. I'm on line 30, starting the isearch.
Is it possible to tell Emacs to do the Isearch but consider line 343000 as the end of the file.
The file has 1,000,000 lines.

american-ninja-warrior
- 3,903
- 2
- 24
- 44
3
votes
1 answer
Limiting Emacs incremental search to a function definition
Any existing package that can do incremental search inside a function definition instead of the whole buffer?
Now the best I can do is to turn on semantic-mode along with semantic-stickyfunc-mode and carefully search within its scope.

cdnszip
- 347
- 1
- 7
3
votes
1 answer
Repeated isearch when rebound to compound key
I don't isearch backwards frequently enough to justify giving it such a valuable keybinding, so I rebound isearch-backward-regexp to C-c r and I noticed that something strange started happening. Normally isearch-backward-regexp will use the previous…

Greg Nisbet
- 877
- 5
- 19
3
votes
1 answer
Searching for multi-line text in many files
I have a phrase, e.g. This is an example phrase, and a collection of text files (coll.d/a.txt, coll.d/b.txt, etc.), and I'm looking for the former in the latter.
The thing is, maybe my pattern is splitted over several lines of text, so plain grep…

Nikana Reklawyks
- 332
- 4
- 15
2
votes
1 answer
How to check from elisp if isearch is in progress?
I have a background process which when finishes switches to a specific buffer. I don't want this process to interrupt my current isearch if I'm doing one, so I'd like to test if an isearch is in progress, and delay switching to that buffer if it is…

Tom
- 1,260
- 8
- 16
2
votes
1 answer
Yanking into a regexp isearch escapes the metacharacters
I noticed today that when I yank a string containing regexp metacharacters into an active regexp isearch, the metacharacters all get escaped. For example, if I've killed the text foo* and yank that string into a search, it becomes foo\*.
My actual…

Sean
- 939
- 4
- 13
2
votes
1 answer
How go to prev search text in minibuffer?
Emacs 26.1, Ido , smex,
Open scratch buffer.
C-s to find text file
Here result:
C-g
Now I want to find another text: text
Here result:
Nice. It's work fine.
But now I want to backward in search history.
So I need again to search text (in…

a_subscriber
- 4,062
- 1
- 18
- 56
2
votes
1 answer
isearch but don't move the cursor until I ask to search
In a large file, I would isearch for the word byebug
but as soon as I type by, my cursor is moved to a line containing the word bystander. (The file actually does not have the word byebug.)
But now
I'm a bit lost with my cursor at this random line.…

american-ninja-warrior
- 3,903
- 2
- 24
- 44
2
votes
1 answer
Customize isearch to start from buffer start
Ctrl-s, isearch-forward is not appealing to me and so, i wrote a wrapper around it to search from the beginning of the buffer always.
(defun sk-isearch-forward (original)
(interactive "sEnter search string: ")
(save-excursion
…

Saravana
- 2,071
- 13
- 32
1
vote
1 answer
Is it possible to prevent screen flashing on combination of `isearch` and `recenter`?
I have followed answer for Emacs: Combine iseach-forward and recenter-top-bottom, replacing (recenter-top-bottom) to (recenter).
My goal is to re-center after each isearch-forward or isearch-backward. When I put same two words into the buffer and do…

alper
- 1,370
- 1
- 13
- 35
1
vote
1 answer
improving isearch
I wonder if I can disable the 'failing overwrapped' warning in the minibuffer and directly wrap around instead if I do a search?
Does anyone know how to facilitate this?
Also there is a slight delay in highlighting occurrences of the search-for…

CD86
- 563
- 2
- 11