#compdef dotfiles _dotfiles() { # 1. Define your paths relative to HOME # The :a modifier turns it into an absolute path for Git's internals local -x GIT_DIR="${HOME}/.dotfiles" local -x GIT_WORKTREE="${HOME}" # 2. Prepare the command line for the real 'git' completion # We replace 'gwrap' (the first word) with 'git' words[1]=git # 3. Tell Zsh to use the official git completion logic service=git _git } _dotfiles "$@"