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

extensions - search current buffer with regex #785

Closed
wants to merge 5 commits into from
Closed

extensions - search current buffer with regex #785

wants to merge 5 commits into from

Conversation

JoseConseco
Copy link

@JoseConseco JoseConseco commented Apr 21, 2021

It will let you search current buffer with regex support.

tele_buffer_search.mp4

User is expected to escape with \ (then in lua script \ is converted to % so that string.find works). I'm new to this so there may be bugs.
Rather than writing this extension, I would rather use:

  • live_grep on current file, but I did not find way to make it work.
  • or use current_buffer_fuzzy_find but without fuzzy, but also I also did not found way to make it work...

In the end me think above extension could be replaced in future with new sorter: non_fzf_regex or something like that. Plus new easy finder: grep(%) + grep(cwd_files)

@Conni2461
Copy link
Member

Why do you want to merge a extension?
The only new thing here seems to be the sorter. the other code is just current_buffer_fuzzy_find isn't it?

@kkharji
Copy link
Member

kkharji commented Apr 28, 2021

It would be better to add it as optional feature to current fuzzy finder and enable regex when that option is passed

@JoseConseco
Copy link
Author

It is based on live_grep (if I remember correctly) but it is using regex and it is using only current file. Preferably instead of merging this extension, I would rather have functionality in Telescope where userI can use any type of search:

  • fuzzy, regex, string_match etc
    and it could work on any target: current file, opened buffers, or cwd files etc. But there is no way to achieve these combinations it seems right now (I'm now to nvim and tele so I may be missing something) . I know its is simple script so feel free to close it if it does not match telescope vision.

@Conni2461
Copy link
Member

Its definitely not based on live_grep its based on current_buffer_fuzzy_find and the only new thing here is the sorter.

I am closing this here because we are not merging extensions into core. extensions are meant for external repos. Also there is an attempt to make live_grep work with regex see #670

@Conni2461 Conni2461 closed this May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants