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

Fuzzy Find / Search in all open buffers #1357

Closed
zoomido opened this issue Oct 19, 2021 · 5 comments · Fixed by #2039
Closed

Fuzzy Find / Search in all open buffers #1357

zoomido opened this issue Oct 19, 2021 · 5 comments · Fixed by #2039
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@zoomido
Copy link

zoomido commented Oct 19, 2021

What I am missing:
In https://github.com/junegunn/fzf.vim there is a command:
:Lines [QUERY] Lines in loaded buffers
This is a fuzzy finder for all lines in all open buffers.

Solution
A similar alternative in telescope.

Describe alternatives you've considered
Currently I'm doing :bufdo vimgrepadd pattern % to populate the quickfix list with a pattern. Unfortunately this is not a fuzzy search.

@zoomido zoomido added the enhancement Enhancement to performance, inner workings or existent features label Oct 19, 2021
@l-kershaw
Copy link
Contributor

I think what you are looking for is the grep_open_files option for the builtin live_grep.
See :h builtin.live_grep() for more details.

@zoomido
Copy link
Author

zoomido commented Oct 19, 2021

Yes this seems indeed to be what I needed! Thank you :)

For reference this is what I did in my config:
nnoremap <leader>L <cmd>lua require('telescope.builtin').live_grep({grep_open_files=true})<cr>

@zoomido zoomido closed this as completed Oct 19, 2021
@zoomido zoomido reopened this Oct 22, 2021
@zoomido
Copy link
Author

zoomido commented Oct 22, 2021

Well after some testing is seems that this is indeed the same as live_grep and not a fuzzy search.
Is there a way to have the same functionality as current buffer fuzzy find but for all open buffers?

@ssh352
Copy link

ssh352 commented Jul 3, 2022

Well after some testing is seems that this is indeed the same as live_grep and not a fuzzy search.
Is there a way to have the same functionality as current buffer fuzzy find but for all open buffers?

I have same question.

@Conni2461
Copy link
Member

Can someone test this PR #2039

For fuzzy find for word under cursor for all open files :Telescope grep_string grep_open_files=true
Or fuzzy find over all open files :Telescope grep_string grep_open_files=true search=

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

Successfully merging a pull request may close this issue.

4 participants