6a2e04fefbd794f050d45e7a717d009e39204431

Author
clutton <clutton0@gmail.com>
Committer
clutton <clutton0@gmail.com>
Date

Message

modify themes/jnrowe.zsh-theme, add host directive "Ξ (mbsd) ~ →"

Diff

 1diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
 2index 7c8a7082e96696931d797f1e847d7eeef2f4c581..0ade9cc60ebc48d9518cc234f1827a0e51038327 100644
 3--- a/themes/jnrowe.zsh-theme
 4+++ b/themes/jnrowe.zsh-theme
 5@@ -1,3 +1,4 @@
 6+autoload -U colors && colors
 7 autoload -U add-zsh-hook
 8 autoload -Uz vcs_info
 9 
10@@ -8,9 +9,10 @@ zstyle ':vcs_info:*' formats \
11 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
12 zstyle ':vcs_info:*' enable git
13 
14-add-zsh-hook precmd prompt_jnrowe_precmd
15+add-zsh-hook precmd prompt_vcs
16+add-zsh-hook precmd prompt_host
17 
18-prompt_jnrowe_precmd () {
19+prompt_vcs () {
20     vcs_info
21 
22     if [ "${vcs_info_msg_0_}" = "" ]; then
23@@ -24,8 +26,17 @@ prompt_jnrowe_precmd () {
24     fi
25 }
26 
27+prompt_host () {
28+    if [[ -n "$SSH_CLIENT" ]]; then
29+        host=" ($HOST)"
30+    else
31+        host=''
32+    fi
33+}
34+
35+
36 local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
37 
38-PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
39+PROMPT='${ret_status}%{$fg[blue]%}${host}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
40 
41 #  vim: set ft=zsh ts=4 sw=4 et: