Skip to content

Commit

Permalink
Revamped zsh attachment. Removed superfluous code.
Browse files Browse the repository at this point in the history
Now uses zsh build in completion.
Chose not to use zsh built in VCS info to keep env var support.
Lots of advice found at: https://git-scm.com/book/sv/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Zsh
  • Loading branch information
Ondkloss committed Nov 26, 2020
1 parent 65d0832 commit 8914222
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 1 addition & 2 deletions .git-bash-for-mac-zsh.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/zsh

autoload -U compinit && compinit
zstyle ':completion:*:*:git:*' ~/.git-completion.bash ~/.git-completion.zsh
autoload -Uz compinit && compinit
source ~/.git-prompt.sh

autoload -U colors && colors
Expand Down
2 changes: 0 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set -e
curl -o ~/.git-bash-for-mac.sh https://raw.githubusercontent.com/fabriziocucci/git-bash-for-mac/master/.git-bash-for-mac.sh
curl -o ~/.git-bash-for-mac-zsh.sh https://raw.githubusercontent.com/ondkloss/git-bash-for-mac/master/.git-bash-for-mac-zsh.sh
curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
curl -o ~/.git-completion.zsh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh

touch ~/.bash_profile
Expand All @@ -15,5 +14,4 @@ echo "source ~/.git-bash-for-mac.sh" >> ~/.bash_profile
touch ~/.zshrc
# Add newline at the end of the '.zshrc' if it doesn't exist
sed -i '' '$a\' ~/.zshrc
echo "setopt PROMPT_SUBST" >> ~/.zshrc
echo "source ~/.git-bash-for-mac-zsh.sh" >> ~/.zshrc
1 change: 0 additions & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
rm ~/.git-bash-for-mac.sh
rm ~/.git-bash-for-mac-zsh.sh
rm ~/.git-completion.bash
rm ~/.git-completion.zsh
rm ~/.git-prompt.sh

sed -i.backup '/source ~\/.git-bash-for-mac.sh/d' ~/.bash_profile
Expand Down

0 comments on commit 8914222

Please sign in to comment.