Questions tagged [search]

Questions about search mechanics inside of Emacs.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Point to bound variables in scope

So, Dr. Racket has a very interesting feature where you can see all occurrences of a bound variable if you hover it: Is there a way to do something similar in Emacs? I'm currently editing C++ code. ...
0
votes
1answer
53 views

Search and Replace for a block on many lines in a dozen files

I have a a bunch of HTML files and in each of them I want to replace a fixed block of approx 30 lines with a one liner. Is there an Emacs command or package which makes this easier? Using e.g. dired-...
11
votes
4answers
3k views

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 ...
1
vote
1answer
19 views

How to multi-word search

When I use swiper to search inside a buffer I can use multiple search words separated by a blank space. This works. But I also want that behaviour when search for a file (C-x f), a variable or ...
0
votes
1answer
34 views

Search and replace in multiples files at once by having them all open as a buffer?

I've done this before in emacs but I can't remember how or which plugins were involved. Basically you marked a bunch of files according to a file extension, and then you got asked for a search string, ...
1
vote
1answer
27 views

Need search function to navigate to last line in continuous occurrence range

I am looking for a way to improve searching by repeating pattern. Let's say some program prints lots of log messages with the same pattern: copying path '/nix/store/lqfjx7x6imy5a9xab1ff5nhg90v089rq-...
0
votes
1answer
14 views

How to adjust the search in file behavior in spacemacs?

Currently, when I using vim searching "/searchforsth" with "n" to search for words. After navigating through the words on this page, the next word that is not on the current page ...
0
votes
0answers
15 views

Emacs Evil Mode permanently highlight all instances of text searched using the `/` key

In Emacs Evil Mode, when I search using the / key, it has the following behavior: It highlights all instances of the match as I am typing after pressing the / key. When I press return, it only ...
0
votes
1answer
89 views

Issues With org-ql and Searching Based On Property Inheritence

I would like to be able to search for all TODO's with a property of FEATURE_NUM, and that property is inherited in my TODO's. Here's what I have in my init.el to make that property inheritable: (...
0
votes
0answers
43 views

How to show arrows for backward (<) and forward (>) search

I had installed emacs and org mode in Fedora Linux and when I clicked the Search (magnifying glass icon) in the toolbar, automatically underneath the toolbar, an arrow button to search backwards (<)...
0
votes
0answers
13 views

How to create commands to search specific kinds of files using `helm-projectile`?

I want to be able to search python, typescript, and markdown files separely with helm-projectile. Is there a way to create distinct keybindings to search the contents of files with each extension. ...
0
votes
0answers
22 views

Way to filter/search authors in magit-cherry

Most of the times I have to backport my commits to the upstream for that I need to only check the cherries which were authored by me, is there a way I can narrow them by the C-sing the author name? I ...
0
votes
1answer
138 views

Can you generate a tags table for CMD scripting?

I am working on an elaborate script for Windows using CMD.EXE scripting. It walks a tree of files and folders and uses our specialized file transfer program to send the tree to a remote location. ...
1
vote
1answer
145 views

org-mode: specifying a hyperlink target as regex and jumping directly to match?

The documentation of a Fortran code, being done in org-mode, is intended to be done in such a way that changing the Fortran source code to be documented should be kept at a minimum. There is the ...
0
votes
0answers
22 views

xml: copy line if tag found below that line and change content between tags from associated list or hash table

I am rather new to emacs and need some keywords which I can than use to search the manual/forum/google. Whenever a special tag name can be found in an xml file I would like to copy that line (tags and ...
2
votes
0answers
29 views

How to get the last project search results?

When searching in project with +default/search-project after opening a result. How do I get back to the previous search results? And ideally to the same position in the results list? The usecase: ...
1
vote
1answer
56 views

How to perform a multi-file regex-search with a regexp that encompass several lines?

Scenario: I want to detect all defcustom sexp that have a :set or :initialize keyword in all Emacs Lisp files inside a directory tree. Searching for newline can be problematic depending of the regexp ...
0
votes
1answer
37 views

Searching in Dired for content in files while filtering files

From Dired, I'd like to be able to search for content pretty much like I do on my MAC Finder, while showing the files that match the criteria/regular expression (and no other files). I don't want the ...
1
vote
1answer
54 views

How to search for words separated by arbitrary whitespace?

The question is general, but here's a specific case: In LaTeX source files, it doesn't matter if two words are separated by one space character, multiple space characters, or even a linebreak - in the ...
1
vote
1answer
31 views

icicles search and replace; need help to do a successfull replace

I try to use Icicles to search and replace. I understand to search with it (some details, that I need), but I'm unable to do a replace. The link below shows a recipe, that I try to follow, but it ...
0
votes
1answer
89 views

How to filter search results by path pattern?

I'm using Projectile with ripgrep. I can search project lines by some pattern, as an example: test 42 will match strings like this so, test is not 42 at all I would like to be able to add additional ...
1
vote
1answer
53 views

Yank / copy / get into a buffer matching regex search results

I am trying to "extract" my search results into a new buffer, but only the matches - not the whole lines. For example I am trying to get a list of HTML color codes used in a file. I can ...
34
votes
5answers
18k views

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 ...
0
votes
1answer
49 views

Search ELPA/MELPA Package repositories

I know searching for packages in the ELPA/MELPA repositories might be available within emacs itself, but I'm just wondering, can I do the search on the Internet as well? Just like I know I can search ...
1
vote
0answers
21 views

How to search amongst DONE items (either archived or not)

I am new to Emacs and wonder how it is possible to search a DONE item. I archive my DONE items from agenda files once every couple months. So some DONE items are in the agenda files themselves and ...
6
votes
2answers
2k views

how do I do case sensitive searches using evil/spacemacs?

I'm trying to perform a search and replace in spacemacs but I need it to be case sensitive when by default it appears to be case insensitive. So I try to do :set noignorecase but then I have this ...
1
vote
1answer
36 views

Search for a capital letter in a string and move the cursor to it

I am trying to learn how to implement regular expressions in emacs. I have a string that looks like this: Fname0 Mname0 Surname0Fname1 Surname1Fname2 I would like to search for any capital letter ...
0
votes
1answer
30 views

"VC method not implemented for backend" for project-find call

I am trying out project based search via project-find-regexp, but I get the error: vc-call-backend: VC method not implemented for backend: find-ignore-file, CVS How can I fix this? I assume this is a ...
0
votes
0answers
22 views

Preserving evil mode search/replace command history

In evil mode, I use a lot of search/replace with %s/pattern/replacement. I have (evil-select-search-module 'evil-search-module 'evil-search) in my ~/.emacs file. However, some of the past search/...
44
votes
8answers
10k views

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?
20
votes
5answers
4k views

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. ...
0
votes
1answer
54 views

Custom search for text under cursor

I would like to write a custom elisp function that searches for a few variants of unicode text under a cursor and highlights their occurrences in the currently open file. For e.g. if my text is ...
1
vote
1answer
54 views

How to make Isearch highlight more matches when I scroll?

upon having used Isearch or C-u C-s to highlight a word, when I use then C-v or M-v for scrolling the highlights remain due to setting (setq-default isearch-allow-scroll t lazy-highlight-...
0
votes
0answers
33 views

Search on org-mode tags directory-wide?

I have a large set of my own tags that I've added to org-tag-alist that I use liberally to tag headings throughout my org files. I would like to search throughout my org directory (recursively) on a ...
0
votes
3answers
57 views

Search for text, print a message about it, and then return cursor to original position

I want to write an Elisp command that searches for a specific string in the backward direction, pauses the cursor there for a second, echoes a message about that occurrence, and then returns the ...
1
vote
1answer
156 views

How to search word under cursor using counsel-git-grep

I am using counsel-git-grep to grep for a string in the current Git repository. When I do M-x counsel-git-grep it opens following in the mini-buffer. 2 git grep: 3 chars more Let say if the ...
0
votes
0answers
39 views

Symbol Highlight Transient State select all words

I am using Spacemacs. I want to move between variables easily and while using #spacemacs/enter-ahs-backward function. I want to select the even word near of some special characters like $!:<> ...
1
vote
1answer
120 views

function to search and replace multiple words - necessary to goto-line 1 every time?

This is a very rudimentary question, but I have a document in which I need to replace many different words fairly frequently, so I created a function that goes like this: (defun chikan () (...
0
votes
0answers
43 views

How to use helm to search a buffer?

I would like to use the helm machinery to search "live" a buffer's lines. Is this possible? If not how would I go about figuring out how to implement this?
24
votes
2answers
4k views

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 ...
1
vote
0answers
77 views

Remember previous text searches history with positions after further text search

TL;DR: Is it possible to go back and forth between different helm-ag searches, and keep the last visited position in each of them? Using Spacemacs’ spacemacs/helm-project-smart-do-search (SPC / ...
1
vote
1answer
34 views

Is there any way to search in the current narrowed subtree in org mode?

I can use C-x n s (org-narrow-to-subtree) to narrow the content to the current subtree, which is great. After doing that, I want to search a keyword in the current narrowed subtree(instead of the ...
1
vote
0answers
54 views

How to replace a block of text with a "query-like" approach all at once?

I want to search and replace a block of text with a "query-like" approach all at once. For example, if I have \emph{``Foo $\bar$ baz''} to be replaced by \emph{Foo $\bar$ baz} using a &...
1
vote
1answer
73 views

Searching in a subtree in orgmode without narrowing

Is there a way to search in org mode in emacs in a certain subtree without narrowing or "narrowing" and "widening" the way to go?
1
vote
1answer
48 views

How can I get the search string from incremental regexp search to use with replace regexp

If I want to do a replace-regexp I usually start with a isearch-forward-regexp so I can get immediate visual feedback on the search string. From there I'd like to grab the search string for using in ...
0
votes
2answers
200 views

How do I search/replace with case sensitive search?

In emacs I'm using M-% to replace occurrences of b_abcd (of which there are only a few) with B_abcd (of which there are very many). Currently Emacs asks if it's OK to replace at each B_abcd, which ...
1
vote
1answer
39 views

tools for camelcase and other means of word separation

Often I am involved with transforming text with one system of word separation (e.g., camelcase) into another system (e.g., hyphen separation, space separation, underscore separation. For example, if I ...
0
votes
1answer
78 views

Search for file content with swiper-all or similar interface

I've been using swiper-all to search for content in buffers. This works really great as I easily can navigate between the files and select the ones I want to work with. Is there some way I can use a ...
0
votes
1answer
76 views

How can I get swiper to remember the last search I ran?

Sometimes I do a search with swiper and navigate to a location in the code that seems like what I was searching for, only to find it wasn't. This is more common with a symbol name that is a little too ...
0
votes
1answer
19 views

Only edit visible lines in sparse tree view

Consider the following org-mode document * Foo ** bar1 :g1: ** bar2 :g2: ** bar3 :g1: ** bar4 ...

1
2 3 4 5 6