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

Only tab complete after no match? #116

Open
esran opened this issue Jul 18, 2019 · 2 comments
Open

Only tab complete after no match? #116

esran opened this issue Jul 18, 2019 · 2 comments

Comments

@esran
Copy link

esran commented Jul 18, 2019

Would it be possible to have the fzf tab completion only kick in after a tab fails to do any completion? Often I want to tab complete something I know is a partial match that I am going to add a * to so I can do something on a (sub)set of files.

e.g.

> ls
test_1.txt
test_2.txt
results_1.txt
results_2.txt

> rm res<tab>
  rm results_
  rm results_*

At the moment, that first tab immediately goes into fzf mode, making it difficult to partially complete a file name. It also feels that more naturally matches existing tab completion modes which tend to only offer you a list when you hit tab and there's no common partial solution.

@jethrokuan
Copy link
Owner

I understand what you're trying to say, and I think the behaviour you're requesting is entirely possible and legitimate. I honestly don't use the tab completion with fzf, and currently don't have the time to look into it, so I'm going to leave it here with a help-wanted tag for the moment. Happy to look into any PR which allows toggling this behaviour via a flag.

@amir20
Copy link

amir20 commented Dec 18, 2020

Although not exactly what was requested, set -U FZF_COMPLETE_OPTS --exact seems to get pretty close to doing this. If there was a --prefix option, that would be even better.

Edit: Turns out set -U FZF_COMPLETE_OPTS --exact --tiebreak=begin --select-1 might be the best of all options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants