Skip to content

Commit

Permalink
refactor(zsh): remove conflicting git completions
Browse files Browse the repository at this point in the history
  • Loading branch information
kutsan committed Nov 13, 2024
1 parent 94f47d2 commit 5aedb0a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .config/zsh/config/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ typeset -A git_aliases=(
c commit
d diff
ds diff
dt difftool
dts difftool
f fetch
l log
ld log
Expand All @@ -42,3 +40,19 @@ for key in ${(k)git_aliases}; do
done
unset git_aliases
unset key

# Remove the Homebrew version of `git` completions, as they are incompatible with Zsh aliases.
function remove_conflicting_git_completions() {
local git_completion_bash="$HOMEBREW_PREFIX/share/zsh/site-functions/git-completion.bash"
local git_completion_zsh="$HOMEBREW_PREFIX/share/zsh/site-functions/_git"

if ([[ -e "$git_completion_bash" ]]) {
command rm "$git_completion_bash"
}

if ([[ -e "$git_completion_zsh" ]]) {
command rm "$git_completion_zsh"
}
}

remove_conflicting_git_completions

0 comments on commit 5aedb0a

Please sign in to comment.