Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make counsel-rg prompt for extra args when using prefix arg. #851

Closed
dieggsy opened this issue Jan 10, 2017 · 10 comments
Closed

Make counsel-rg prompt for extra args when using prefix arg. #851

dieggsy opened this issue Jan 10, 2017 · 10 comments

Comments

@dieggsy
Copy link
Contributor

@dieggsy dieggsy commented Jan 10, 2017

Would be nice if counsel-rg did this (counsel-ag does since commit 4dd650c, and as I understand it the code for the two is almost identical).

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Jan 11, 2017

It would be nice to bring these functions into a single interface. There's quite a bit of code duplication there.

@dieggsy
Copy link
Contributor Author

@dieggsy dieggsy commented Jan 11, 2017

I agree. What do you think the best way to unify these is? A macro? A single function with an argument specifying which search utility to use?

I could potentially give this a try.

@izahn
Copy link

@izahn izahn commented Dec 5, 2017

I really miss this. Is there currently any way to pass extra arguments to rg when calling counsel-rg interactively?

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Dec 5, 2017

@izahn What's your use case? I mean which setting you use for counsel-rg-base-command, and which flags do you want to add to it?

@izahn
Copy link

@izahn izahn commented Dec 5, 2017

I often want to add a -t or -g flag to search only specific file types in the common case where searching everything is too slow. I use the default counsel-rg-base-command setting.

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Dec 5, 2017

@izahn Thanks, but it's still not clear for me what -t or -g do. It seems rg has no man entry.

In any case, you should be able to add extra args now with a prefix arg.

@noctuid
Copy link

@noctuid noctuid commented Dec 5, 2017

rg should have a manpage:

-t, --type TYPE ...
       Only search files matching TYPE.  Multiple type flags may be provided.  Use the --type-list flag to list all available
       types.
...
-g, --glob GLOB ...
       Include or exclude files for searching that match the given glob.  This always overrides any  other  ignore  logic  if
       there  is  a  conflict,  but is otherwise applied in addition to ignore files (e.g., .gitignore or .ignore).  Multiple
       glob flags may be used.  Globbing rules match .gitignore globs.  Precede a glob with a '!' to exclude it.

       The --glob flag subsumes the functionality of both the --include and --exclude flags commonly found in other tools.

       Values given to -g must be quoted or your shell will expand them and result in unexpected behavior.

       Combine with the --files flag to return matched filenames (i.e., to replicate ack/ag's -g flag).  For example:

              rg -g '*.foo' --files

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Dec 6, 2017

@noctuid Thanks. I just tried C-u C-c k RET -t org RET tes in this repository. It works as expected.

@dieggsy
Copy link
Contributor Author

@dieggsy dieggsy commented Feb 12, 2018

Closing as 83d85ac solved this. Thanks

@dieggsy dieggsy closed this Feb 12, 2018
@d1egoaz
Copy link

@d1egoaz d1egoaz commented May 30, 2018

FYI keep and eye on #1559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants