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

Comments

@dieggsy
Copy link
Contributor

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

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 added a commit that referenced this issue Dec 5, 2017
@abo-abo

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2018

Closing as 83d85ac solved this. Thanks

@dieggsy dieggsy closed this Feb 12, 2018

@d1egoaz

This comment has been minimized.

Copy link

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
Projects
None yet
5 participants
You can’t perform that action at this time.