-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
interactive global search #196
Comments
Should this be a core feature of Helix or be implemented as a plugin? |
I personally think this should be core feature. We already have like skim like thing, implementing ripgrep is just near. |
is a dependecy on ripgrep something you want to make mandatory? I would imagine having these functions pluggable |
I don't think we will pull in ripgrep. We may be implementing our own which is slightly slower compared to ripgrep but work well for our usecase. |
We could also just import the https://docs.rs/grep-searcher/0.1.7/grep_searcher/ And |
so excuse me for being an idiot. The file picker is already aweesome! cancel the FZF request |
I do think a preview window + some way to actually search through files would be useful though :) I think there should be a general way to pipe data into the built-in picker. |
I agree, after using it last night i did miss the preview window + the actual fuzzy finding where i could use multiple terms seperated by whitespace rather then the exact path/to/target/file |
The finding is fuzzy (we use |
Does Helix use skim as a library? |
We're using the |
Another vote for searching via the |
Hi! I too think that being able to perform a search in current workspace would be immensely helpful. So I started messing around and implemented something myself . It's not pretty I know, but it's something for us to talk about as least. |
That's pretty cool! I think instead of I'm also wondering if we might want to do this without the prompt and just do this interactively in the picker as the user types. It's a bit wasteful though so maybe there could be a key to refresh (ctrl-r or something like it) The binary detection part is really cool and we likely want to use that in the file preview as well to avoid displaying binary files (on |
You're right, I will be cleaning it up shortly :) Edited: Updated. But I seem to have messed up my forked branch to include a commit that was not mine(due to some incorrect |
@archseer |
That would be an option, but from what I've seen in other plugins (telescope.nvim) there's simply no fuzzy file select, you just scroll the list (we could probably add ctrl-d/u page up/down so the list is easier to scroll faster). When I'm searching for something I usually don't know the filename so I'll traverse the list to find the correct entry. I do see a case for being able to limit the set of files we search for beforehand though, for example if I'm searching for results inside |
@archseer I think this is implemented, any reason to keep this open? |
Interactive prompt is not available yet so it will be kept open. |
I came up with def rghx [] {
let li = ((rg -e '.' --no-heading -n --color always | fzf --ansi) | lines | split row ':')
hx ([$li.0, ':', $li.1] | str join)
} run it in the repo root folder, and start typing to search, enter to open in helix can be easily translated to different shell script |
This is something I use in bash #!/bin/bash
# Search using rg and fzf with preview
out=$(rg . --line-number --column --no-heading --glob '!.git' | \
fzf +i --exact --delimiter : --preview 'batcat --style=full --color=always --highlight-line {2} {1}' --preview-window 'up,~4,+{2}+4/2')
# Remove cruft leaving something like: 'file:line:column'
ref=$(echo $out | sed -E 's/([a-zA-Z0-9/-_]*):([0-9]*):([0-9]*):.*/\1:\2:\3/')
hx $ref Would be super useful to open the found file in a running instance of helix... |
I'm not sure about the running instance, but you can open it in new one by editing
I have this in my |
@davxy, and anyone else interested: I hacked something together for this, you can read about it on my post on r/HelixEditor. |
This is cool, but limited to wezterm, right? Is there an option to do live-grep'ing project-wide inside helix itself or are there plans to add it? |
It’s like I said on the Reddit post, it’s a opinionated setup but I’m certain it can be adjusted. I’m pretty sure Kitty and Tmux have similar mechanisms for sending keys/text to another pane, for example. Adding it natively in Helix is the whole point of this issue. I just wanted to share my workaround for those who (like me) are waiting for the native feature. |
Potential inspiration for a solution (does not have the matches in file preview due to being additionally complexity): |
More relevant would be to use this: #7814 |
Similar to #196 (comment) but using zellij+fzf https://github.com/davxy/script-nest/blob/main/bin/helix-ext The scripts allows to do a couple of IMO useful things (see the script help). Modifications to helix config:
|
I think this feature is related to this issue: #2177 |
That would involve building in a terminal emulator insixe helix which is much much more work while also being a lot less integrated with the rest of our UI. @the-mikedavis already has a working implementation of this based on #8021 and #7265. I have deamoed it and find it quite a bitee nicer tgab other options (and especially since it integrates well with the rest of the editor, which is the reason the picker is builtin to begin with). The columary picker really is a very nice approach. So this issue just needs time for the implementation to be finished and land in master |
Ah I meant to post a demo here after assigning myself: https://asciinema.org/a/607253 Global search becomes a DynamicPicker like workspace symbol search ( It needs some more tweaking but I plan to make a draft PR for it after #8021 is merged. |
As far as I know, Helix uses |
Until this issue is fixed here is what I use. I ported the wezterm specific method mentioned in the blog post to tmux since it is terminal agnostic. Kooha-2023-12-05-15-02-36.online-video-cutter.com.mp4Add these three files to your path:
Add it to your config: [keys.normal.space]
"/" = ":pipe-to live-grep-in-split-tmux" |
@the-mikedavis - don't mean to rush things, just pinging in case this got buried (always does for me). Is there a draft of the code to build/play around with now that #8021 has been merged? |
It's implemented in #9647 |
Are there any plans to fix the regression, that it's not supported anymore to filter the results of a global search? Edit: Never mind, found how the filtering is done now in the docs: https://docs.helix-editor.com/master/pickers.html#using-pickers |
The reason I use vim is for ripgrep and fzf. This makes for extremly fast navigation.
Request:
Ability to index files in active directory and search via FZF
Ability to grep through fies in active directory and pipe results in fzf
ripgrep file_config | fzf
<- this opens up in same preview window that FZF provides.There are many blogs etc writing about this method in vim. EG: https://sidneyliebrand.medium.com/how-fzf-and-ripgrep-improved-my-workflow-61c7ca212861
The text was updated successfully, but these errors were encountered: