GithubHelp home page GithubHelp logo

Searching multiple paths at once about ag.el HOT 4 OPEN

harold avatar harold commented on June 14, 2024
Searching multiple paths at once

from ag.el.

Comments (4)

harold avatar harold commented on June 14, 2024 1

Ha! That's nuts 🥜.

That's a few too many steps for me. What I think I'd like, and what I may try to do with the new list :files argument is to have a way of quickly specifying some root search paths (maybe a file in my project's root directory, or maybe just some hardcoded set of search paths) and then to be able to quickly search all those, maybe with a sequence as short as M-x ag-something RET search-string RET.

Definitely doing it in general involves either a lot of configuration or a lot of steps. I sometimes find myself going out to my terminal and just doing cd ..., then ag --clojure search-string. This is quite general and pretty fast, but two obvious downsides (1) the results aren't in an emacs buffer for going between them w/ next-error and (2) no good way to do excludes if there are lots of siblings in the parent folder.

Regardless, I appreciate your efforts here and hope we all have fun searching for a long time to come.

from ag.el.

vitorqb avatar vitorqb commented on June 14, 2024

The PR #157 added a functionality similar to what you are looking for. With elisp you can do something like

(ag/search "x" "/home/vitor" :files '("test/a" "test/b"))
-*- mode: ag; default-directory: "~/" -*-
Ag started at Wed Jul 31 20:30:27

ag --literal --group --line-number --column --color --color-match 30\;43 --color-path 1\;32 --smart-case --stats -- x test/a test/b
File: test/a
1:1:x

File: test/b
1:1:x
2 matches
2 files contained matches
2 files searched
2 bytes searched
0.000325 seconds

Ag finished at Wed Jul 31 20:30:27

I hope this helps!

from ag.el.

harold avatar harold commented on June 14, 2024

Woah, that's neat! Thanks. I will play with this.

from ag.el.

vitorqb avatar vitorqb commented on June 14, 2024

Nice :) . There is also the unmerged pr #158, it tries to add a nice integration with dired. If/once it gets merged you can do something like this gif: https://gist.githubusercontent.com/vitorqb/291b7129effd0f85885fb30cfdcf6ebf/raw/1e18f2fb88c28a7258732319e7b2893f3d17c0a5/img.gif

from ag.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.