git: enable zsh completion
Git ships with a zsh completion script, but this script was previously only available at $out/share/git/contrib/completion/git-completion.zsh, which is not a path (or a filename) that would be discovered by a typical zsh installation. This commit symlinks that file to $out/share/zsh/site-functions/_git, which is a more standard location. That zsh completion script is mostly a wrapper around the Bash completion script, so this commit also patches the former so that it can "find" the latter.
This commit is contained in:
parent
8847d57763
commit
35b403bf12
@ -145,6 +145,12 @@ stdenv.mkDerivation {
|
||||
ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/git
|
||||
mkdir -p $out/etc/bash_completion.d
|
||||
ln -s $out/share/git/contrib/completion/git-prompt.sh $out/etc/bash_completion.d/
|
||||
mkdir -p $out/share/zsh/site-functions
|
||||
ln -s $out/share/git/contrib/completion/git-completion.zsh $out/share/zsh/site-functions/_git
|
||||
|
||||
# Patch the zsh completion script so it can find the Bash completion script.
|
||||
sed -i -e "/locations=(/a \${"\t\t"}'$out/share/git/contrib/completion/git-completion.bash'" \
|
||||
$out/share/git/contrib/completion/git-completion.zsh
|
||||
|
||||
# grep is a runtime dependency, need to patch so that it's found
|
||||
substituteInPlace $out/libexec/git-core/git-sh-setup \
|
||||
|
Loading…
x
Reference in New Issue
Block a user