How to enable git file tab completion with zsh compinit?

后端 未结 2 788
感动是毒
感动是毒 2021-02-05 13:28

I have a problem with the zsh tab completion: After running:

autoload -U compinit
compinit

Git tab completion for files does not work any more.

2条回答
  •  伪装坚强ぢ
    2021-02-05 14:08

    (I'm adding an answer here mostly to get it off the unanswered list.)

    As you can see from the comments, it does work. I believe the whole zsh situation has recently improved significantly, too:

    commit 06f44c3cc5ca5eca638f300a518c65aa98d26d6d

    Date: Mon Sep 6 08:33:19 2010 -0400

    completion: make compatible with zsh

    Modify git-completion.bash so that it also works with zsh when using bashcompinit. ...

    So, if you happen across this googling, and your completion isn't working, try upgrading your git-completion.bash (link points to the blob from git.git HEAD). Current git version is 1.7.3.2; it should make it into the next one.

提交回复
热议问题