is it possible to get branch completions when writing 'gd'?
Hey @yuvals1! We essentially make use of the completions provided by git, which include branches for diff. Which shell are you using? If you're using fish, this might be related to #418.
how exactly are forgit completions supposed to work? i have good completions for git.
i have this line in my zshrc for forgiit:
[ -f $HOMEBREW_PREFIX/share/forgit/forgit.plugin.zsh ] && source $HOMEBREW_PREFIX/share/forgit/forgit.plugin.zsh
and unless i explicitly add compdef _git_diff forgit::diff (for gd for example), the completions don't work.
i also have zinit snippet OMZP::git. maybe it interferes with forgit completions somehow?
I'm assuming you're using zsh and installed fzf through brew from your previous response. Is that correct?
how exactly are forgit completions supposed to work?
The only step necessary for working completions with zsh is that completions/_git-forgit has to be placed in a directory that is in your $fpath. The brew installation script handles that for you. completions/_git-forgit handles the necessary compdef bindings.
To make sure that completions/_git-forgit is present in you $fpath could you please run the following in your zsh and send me the results?
for line in $fpath; do grep _git-add "$line/"**/*(-.); done
i also have zinit snippet OMZP::git. maybe it interferes with forgit completions somehow?
We had a user that had similar issues with zinit previously. Please take a look at #330 and see if something in there helps.
❯ for line in $fpath; do grep _git-add "$line/"**/*(-.); done
/usr/local/share/zsh/site-functions/_git-forgit: add) _git-add ;;
/usr/local/share/zsh/site-functions/_git-forgit:(( $+functions[_git-add] )) || _git
/usr/local/share/zsh/site-functions/_git-forgit:(( $+functions[_git-add] )) || return 1
/usr/local/share/zsh/site-functions/_git-forgit:compdef _git-add forgit::add
/usr/local/share/zsh/site-functions/_git-forgit: add) _git-add ;;
/usr/local/share/zsh/site-functions/_git-forgit:(( $+functions[_git-add] )) || _git
/usr/local/share/zsh/site-functions/_git-forgit:(( $+functions[_git-add] )) || return 1
/usr/local/share/zsh/site-functions/_git-forgit:compdef _git-add forgit::add
zsh: no matches found: /usr/share/zsh/site-functions/**/*(-.)
/usr/share/zsh/5.9/functions/_git:(( $+functions[_git-add] )) ||
/usr/share/zsh/5.9/functions/_git:_git-add () {
is that the desired output?
is that the desired output?
Yes. This means forgit completions are correctly placed inside you $fpath. Compsys should handle the rest from there. My guess would be that the issue is caused by zinit in some way. Could you try to build a simple .zshrc file without zinit that simply sources forgit.plugin.zsh and see if that works?
@yuvals1 Did the last comment help you with this? Does the issue still persist?