X-Git-Url: https://arthur.barton.de/gitweb/?p=OhMyZshExtensions.git;a=blobdiff_plain;f=alex.zsh-theme;h=c01b616fa8157efac65b0331e65ebd343a680c7f;hp=0c08595b7f8001c3416e9fd0e80060450abdfb21;hb=338fb793cd6fa37b06e5646885c9b88b556279fc;hpb=5a7e7af72331de681ae1e3c24079e3d24a76b9e9 diff --git a/alex.zsh-theme b/alex.zsh-theme index 0c08595..c01b616 100644 --- a/alex.zsh-theme +++ b/alex.zsh-theme @@ -1,6 +1,5 @@ # Alex "oh my ZSH" theme # Based on the "Sunrise" theme, thanks! -# 2015-03-08, alex@barton.de # Color shortcuts; %B sets bold text B=$fg_no_bold[blue] @@ -27,9 +26,17 @@ function custom_git_prompt() { echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/} $(parse_git_dirty)$(git_prompt_ahead)$ZSH_THEME_GIT_PROMPT_SUFFIX" } +ZSH_THEME_HOSTNAME_PROMPT_PREFIX="" +ZSH_THEME_HOSTNAME_PROMPT_SUFFIX="%{$RESET%}:" + +function custom_hostname_prompt() { + [ -z "$SSH_CLIENT" ] && return + echo "$ZSH_THEME_HOSTNAME_PROMPT_PREFIX$(hostname -s)$ZSH_THEME_HOSTNAME_PROMPT_SUFFIX" +} + local return_code="%(?..%{$R%}%? ↵%{$RESET%})" -PROMPT='${PREFIX}%B%2~%b $(custom_git_prompt)%{$G%}%B$%b%{$RESET%} ' +PROMPT='$(custom_hostname_prompt)%B%2~%b $(custom_git_prompt)%{$G%}%B$%b%{$RESET%} ' RPS1="${return_code}" unset LSCOLORS