sorin-ionescu / prezto

The configuration framework for Zsh
MIT License
13.99k stars 4.49k forks source link

[Question] autocomplete only branches when git checkout #1760

Open kud opened 4 years ago

kud commented 4 years ago

Hey, when I type $ git co <tab>, I'd like to have only branches, not tags. Is there a way to do that?

Because:

image

is annoying.

Thank you!

srijanshetty commented 4 years ago

I have custom shortcuts to autocomplete various git entties like tags, branches, hashes using fzf which I invoke using a keybinding of h.

The code for the same is here: https://github.com/srijanshetty/cli-goodies/blob/master/settings/101-fzf.zsh and depends on fzf.

This isn't an exact answer for your question, but I believe that using contextual keybindings in git is much better than using generic autocomplete.