-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminimalmike.zsh-theme
More file actions
57 lines (48 loc) · 1.75 KB
/
minimalmike.zsh-theme
File metadata and controls
57 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[ "
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*%{$reset_color%}%{$fg[white]%}]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} "
ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_HG_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_HG_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
vcs_status() {
if [[ $(whence in_svn) != "" ]] && in_svn; then
svn_prompt_info
elif [[ $(whence in_hg) != "" ]] && in_hg; then
hg_prompt_info
else
git_prompt_info
fi
}
kube_status() {
kubectl config view --minify --output 'jsonpath={..current-context}'
}
prompt_ip() {
curl -s icanhazip.com
}
tf_prompt_info() {
# dont show 'default' workspace in home dir
[[ "$PWD" != ~ ]] || return
if [ -d .terraform ]; then
workspace=$(terraform workspace show 2> /dev/null) || return
echo "[ ${workspace}]"
fi
}
prompt_cf() {
# print the cloudfoundry target information
if [ -z $CF_HOME ]; then
cf_home=~/.cf;
else
cf_home=$CF_HOME;
fi
organization=`cat $cf_home/config.json | jq '.OrganizationFields.Name' | tr -d '"'`
space=`cat $cf_home/config.json | jq '.SpaceFields.Name' | tr -d '"'`
echo "[ $organization/$space]"
}
RPS1='%{$fg_bold[blue]%}$(kube_status)%{$reset_color%} %{$fg_bold[red]%}$(prompt_ip)%{$reset_color%}'
PROMPT='%{$fg_bold[green]%}%2~%{$reset_color%} $(vcs_status) $(tf_prompt_info) $(prompt_cf) » %b '