diff --git a/roles/zsh/files/.zsh/configs/plugins.zsh b/roles/zsh/files/.zsh/configs/plugins.zsh index 3c7bf5e3..6a1243e0 100644 --- a/roles/zsh/files/.zsh/configs/plugins.zsh +++ b/roles/zsh/files/.zsh/configs/plugins.zsh @@ -8,5 +8,3 @@ antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-syntax-highlighting antigen apply - -eval "$(starship init zsh)" diff --git a/roles/zsh/files/.zsh/configs/prompt.zsh b/roles/zsh/files/.zsh/configs/prompt.zsh new file mode 100644 index 00000000..ece80231 --- /dev/null +++ b/roles/zsh/files/.zsh/configs/prompt.zsh @@ -0,0 +1,14 @@ +source /usr/lib/git-core/git-sh-prompt + +setopt promptsubst + +git_prompt() { + local branch="$(git symbolic-ref HEAD 2> /dev/null | cut -d'/' -f3)" + local branch_truncated="${branch:0:30}" + if (( ${#branch} > ${#branch_truncated} )); then + branch="${branch_truncated}..." + fi + + [ -n "${branch}" ] && echo " (${branch})" +} +export PS1="in %{$fg[blue]%}%~%{$fg[yellow]%}$(git_prompt)%{$reset_color%} %(?.$.%{$fg[red]%}$)%b " diff --git a/roles/zsh/files/.zshrc b/roles/zsh/files/.zshrc index 5dd3d7b6..f26e05f8 100644 --- a/roles/zsh/files/.zshrc +++ b/roles/zsh/files/.zshrc @@ -12,6 +12,7 @@ sources=( 'path' 'platformsh' 'plugins' + 'prompt' 'post/completion' )