git:completion: Fix command not found error

_git has to be loaded before other functions can use its completion
functions.

Hint to this found at: https://unix.stackexchange.com/a/269818
This commit is contained in:
2021-05-10 17:28:22 +02:00
parent b82a9d2221
commit 4053920f53

View File

@@ -38,6 +38,10 @@ compdef nvim-man=man
# Copy git completion for arguments
compdef _git-log glog
compdef _git-checkout git-checkout-worktree
# Run git's completion once to avoid a `command not found` error when using the
# completion functions on other programs without having completed something for
# git before in the same session.
_git &>/dev/null || true
# Do not sort `git checkout`s completion
zstyle ":completion:*:git-checkout:*" sort false