fix(zsh): g function not autocompleting

This commit is contained in:
Oliver Davies 2022-07-13 00:03:34 +01:00
parent 6dc90947a5
commit 6de17552a4
5 changed files with 20 additions and 28 deletions

View file

@ -3,13 +3,13 @@ setopt prompt_subst
git_branch() {
local branch="$(git symbolic-ref HEAD 2> /dev/null | cut -d'/' -f3)"
[ -n "${branch}" ] && echo " (${branch})"
[ -n "${branch}" ] && echo " ${branch}"
}
git_commit() {
local commit_sha="$(git rev-parse --short HEAD 2> /dev/null)"
[ -n "${commit_sha}" ] && echo " [${commit_sha}]"
[ -n "${commit_sha}" ] && echo " [%{$fg[yellow]%}${commit_sha}%{$reset_color%}]"
}
export PS1='%{$fg[blue]%}%1d%{$reset_color%}%{$fg[green]%}$(git_branch)%{$reset_color%}%{$fg[yellow]%}$(git_commit)%{$reset_color%} $ '
export PS1='%{$fg[blue]%}%~%{$reset_color%}%{$fg[green]%}$(git_branch)%{$reset_color%}$(git_commit) $ '