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

fzftselect supports tag completion #18

Open
ri-aje opened this issue Jul 26, 2021 · 5 comments
Open

fzftselect supports tag completion #18

ri-aje opened this issue Jul 26, 2021 · 5 comments

Comments

@ri-aje
Copy link

ri-aje commented Jul 26, 2021

hi, I noticed fzftselect doesn't have tab completion as the builtin tselect has. so if I type in a partial tag name then press tab, vim's tselect gives me all tags matching the prefix so far without selecting/committing any of them, just like bash tab completion, whereas with fzftselect, I just get a ^I symbol (the literal tab char?) on the command line, which is somewhat inconvenient, since I didn't get the completions, and I have to remove the unintended ^I. this prevents fzftselect as a dropin replacement to the builtin tselect. any chance to have fzftselect behaves the same here? thanks.

@zackhsi
Copy link
Owner

zackhsi commented Aug 9, 2021

Hey! Tab completion is an interesting use case.

Tab selecting a precise result is somewhat tangential of a selection/filtering mechanism to fzf. I think in this case I would recommend you lean into fzf's search syntax. Specifically, because of its powerful filtering, you can actually start with a more basic query, i.e., all your tags, and then filter using the syntax. A helpful command you could check out is :Tags.

@ri-aje
Copy link
Author

ri-aje commented Aug 9, 2021

not quite the same thing. my tag file is pretty big, several GBs. fzf Tags spent quite some time just to parse the whole thing. before my target tags are parsed, the fzf nicety brings no result.

whereas with tab completion, I can start type then press tab, at which point, the binary search has a prefix to start with, which significantly reduces match count and parse job complexity. even better, I get the flexibility to decide when/where to press tab and trigger the search, and I can do multiple tabs in the same tselect search and progressively refine the search.

not so much with fzf Tags which feels like it has to take in all tags, even when I give it a search term, e.g., :Tags ^somePrefix, there is a noticeable delay before fzf shows my target tags. I tested with carefully chosen prefix such that there should be only a few matches, vim tselect responds instantaneously as expected, fzf Tags feels like runs the same linear search and missed the optimization opportunity, and becomes practically unusable.

@zackhsi
Copy link
Owner

zackhsi commented Aug 9, 2021

Gotcha, you want to use fast builtin tab completion for tags instead of loading the entire tags file and fzf filtering.

Regarding builtin tab completion — does pressing the tab key autocomplete an entire tag entry, or just as many characters until the next character has multiple matches?

At what point would you want to pipe the results to fzf?

@ri-aje
Copy link
Author

ri-aje commented Aug 9, 2021

Gotcha, you want to use fast builtin tab completion for tags instead of loading the entire tags file and fzf filtering.

Regarding builtin tab completion — does pressing the tab key autocomplete an entire tag entry, or just as many characters until the next character has multiple matches?

the first tab shows me a grid view and vim command line is not changed. the rest tabs iterate through the matching list and vim command line is changed to the current tag. other chars are reflected as is on the command line, and can be triggered for further tabs. as far as I can tell, there is no auto fill up to the next branching point, although I wish it does.

At what point would you want to pipe the results to fzf?

tselect somePrefix then pipe to fzf?

@zackhsi
Copy link
Owner

zackhsi commented Aug 13, 2021

That makes sense and sounds like a performant pipeline. I don't have the bandwidth, but it's a good feature request 👍

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

No branches or pull requests

2 participants