Questions about search mechanics inside of Emacs.
Questions tagged [search]
306 questions
55
votes
9 answers
How do I find text across many open buffers?
Lets say I have 10 buffers open, and I want to find all occurrences of blah in all 10 buffers. How would I do this?

nixeagle
- 2,407
- 3
- 17
- 14
39
votes
5 answers
What is the easiest way to search all useful files inside a single project?
What is the easiest way to search for a regexp throughout the contents all files in the current project, skipping files that are not useful?
Useless files are things like compiled files, imported libraries,
version-control files, etc.
I’m aware of…

Malabarba
- 22,878
- 6
- 78
- 163
29
votes
3 answers
Match two spaces with incremental search
When searching using:
C-s SPC SPC
Also matches single spaces. I want to match exactly two space.

Rovanion
- 975
- 7
- 20
26
votes
2 answers
Counsel M-x always shows "^"
I installed Counsel/Ivy/Swiper and so far everything works fine. But when I call counsel-M-x via key bind M-x an "^" char is always added. I have no clue why this is happening and how to get rid of it (it does not interfere with the counsel-M-x…

dmw
- 363
- 3
- 5
23
votes
5 answers
Getting number of occurrences, during incremental search (C-s / isearch-forward)
Inspired by modern browsers, I'd love to be able to see how many occurrences there are of some string, when I search for it – like the "10 of 37" at the top-right corner of the screenshot below.
Is there a way of getting this in Emacs? Presumably,…

ShreevatsaR
- 880
- 6
- 19
18
votes
2 answers
Only show lines containing phrase/regex
I would like to see all the lines from the current buffer, that contain some phrase, or match regex.
Example:
My buffer:
dam madam
madam
this is da
m a
dam 1
dam 2
dam pi
dam 321:)
is dam 2?
Looking for dam. Result:
dam madam
dam 1
dam 2
dam…

MatthewRock
- 1,453
- 13
- 27
13
votes
7 answers
How to search the Emacs Lisp Reference Manual?
Sometimes describe- or apropos- are not enough. How can I search the Emacs Lisp Reference Manual (C-h i m elisp) from within emacs?

caisah
- 4,056
- 1
- 23
- 43
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
Helm: search within buffer feature?
A pretty basic Helm question. What is the Helm window/command/feature that lets us search for text (preferably using regexp) within any type of buffer (i.e., including read-only such as w3m)?
In other words, I'm looking for Helm's equivalent of…

iceman
- 1,078
- 1
- 9
- 19
11
votes
4 answers
helm-ag (or similar) find in javascript files only
I'd like to restrict find/grep to (say) only javascript files (mainly because that's what i do in "another editor").
Javascript files in my legacy Ruby-on-Rails project have one of these file extensions:-
.js, .js.erb, .coffee, .js.coffee,…

mustISignUp
- 243
- 1
- 7
11
votes
4 answers
How to convert a series of lines into a working HTML list?
Right now, this is a task I find a lot easier in something like gedit, because I can just replace "\n" (the line break) with "\n" and then I have a list.
One of the few little things I don't seem to be able to in Emacs quickly, but…

mattl
- 215
- 2
- 7
11
votes
2 answers
Search through the values of all variables in Emacs
I'd like to find which variables contain a certain value.
Is there a way to do a regex search through the values of every variable in Emacs?

izkon
- 1,798
- 10
- 23
11
votes
4 answers
How to search in multiple files with Emacs without grep?
There is a folder with many sub-folders, files and I would like to search for a given piece of text in all of these files with Emacs on a Windows 10 machine. (I know about M-x grep, but it does not work in Windows environment.)
Is there any way to…
user14685
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
3 answers
Recursively find all files from a folder containing a regexp in the filename, using helm
How can I find all files from a folder and its subfolders recursively, containing a regexp in the filename, using helm?
For example: how to search for all files with the extension .el and containing the string dired in the directory emacs-24.3 its…

caisah
- 4,056
- 1
- 23
- 43