On Mon, Jan 30, 2012 at 12:59 PM, Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote: > On Mon, Jan 30, 2012 at 10:39 AM, Matthieu Moy > <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote: >> Felipe Contreras <felipe.contreras@xxxxxxxxx> writes: >> >>> +ZSH_VERSION='' . /usr/share/git/completion/git-completion.bash >> >> Probably stating the obvious, but this path shouldn't be hardcoded. >> >> Something along the lines of >> >> ZSH_VERSION='' . $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash >> >> should do it (mostly untested, and written by a non-ZSH expert). > > Yes, it's hard-coded, because there's no way to know where is this > file. In my case, it's on ~/.git-completion.sh, and this one that I am > proposing sits in ~/.zsh/completion/_zsh, so your proposal breaks > things completely for me. > > I will think about it, but I think for now, users of this script > should set that manually--if for some reason they don't want to use > the default. > > Maybe we should use zstyle so they can configure it on their .zshrc? This seems to do the trick: zstyle -s ":completion:$curcontext:" script script test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash ZSH_VERSION='' . "$script" .zshrc: zstyle ':completion:*:*:git:*' script ~/.git-completion.sh -- Felipe Contreras -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html