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 live_grep take a list of files in addition to the list of folders #1962

Closed
danielo515 opened this issue May 24, 2022 · 6 comments
Closed
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@danielo515
Copy link

Is your feature request related to a problem? Please describe.
I am always frustrated with how hard is for me to refine searches while doing live_grep. Many times I get a set of files that I want to re-search on, limiting the search to those files.
This is something this picker kind-of already does, but limited to open buffers.

Describe the solution you'd like
I propose to add another option to live_grep to limit the search to a set of files. This way I will able to chain other searches to refine them in a new live_grep picker.

Describe alternatives you've considered
Right now I should create clone of live_grep in my user space and use that picker instead

Additional context
This will empower the users to easily create workflows like the described in #793 (or similar to)

@danielo515 danielo515 added the enhancement Enhancement to performance, inner workings or existent features label May 24, 2022
@Conni2461
Copy link
Member

search_dirs option is not only limited to dirs. (its a bad name) but its basically the [PATH...] part from rg [OPTIONS] PATTERN [PATH...]

so this lua require("telescope.builtin").live_grep({ search_dirs = { "file_b", "file_a" } })

@danielo515
Copy link
Author

search_dirs option is not only limited to dirs. (its a bad name) but its basically the [PATH...] part from rg [OPTIONS] PATTERN [PATH...]

so this lua require("telescope.builtin").live_grep({ search_dirs = { "file_b", "file_a" } })

That's what I thought, but I tried and I didn't got any results. Maybe I did some additional mistake. Have you verified that such thing works?

@Conni2461
Copy link
Member

Conni2461 commented May 29, 2022

yes tried it before posting that snippet, first on cli after that with telescope

@danielo515
Copy link
Author

yes tried it before posting that snippet, first on cli after that with telescope

You're right, it works. It is just that live_grep does not show anything until you start typing, so it is easy to get confused by that.

Can an annotation be added to the docs so this feature is not overlooked by other devs and it is nor deleted by the core team?

@Conni2461
Copy link
Member

it is nor deleted by the core team

😕

PR welcome

@Conni2461
Copy link
Member

clarified the docs in the current dev branch: 314404c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

No branches or pull requests

2 participants