简体   繁体   中英

zsh git COMMAND autocomplete and filename autocomplete together?

NOTE: I know there are many questions about autocomplete, but I am specifically asking a question about autocompletion of the git command, not regular autocomplete for listing files in a directory.

I am running Mac Catalina and have finally decided to hop on the zsh train. I wanted to get git command auto complete working (ie I type git a and hit tab and options for add , apply , etc come up).

I performed the recommended addition of autoload -Uz compinit && compinit to my ~/.zshrc file and voilà I had git command completion. Yay!

However, once I get to the git add point and try to tab complete to get the names of the files in the directory, I get nothing. Regular tab completion for ls , cp , etc work fine, but not for git after the addition of a command.

Is there a way to fix this problem so that I can get both the command autocomplete AND the file autocomplete working?

It should be working. Have you definitely got modified or untracked files in your current directory? I'd recommend the following configuration style so that it will tell you:

zstyle ':completion:*:warnings' format 'No matches for: %d'

Does completion after something else like git mv work?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM