-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkrak3n.zsh-theme
71 lines (58 loc) · 1.54 KB
/
krak3n.zsh-theme
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env zsh
#
# Chris ZSH Theme
#
# Colours
YELLOW=003
GREY=008
BLUE=004
RED=001
MAGENTA=005
GREEN=002
NEWLINE=$'\n'
# User / Dir
function user {
echo "%{$FG[$BLUE]%}%{$FX[reset]%} %n %{$FG[$YELLOW]%}%{$FX[reset]%} %."
}
# Kubernetes Conctext / Namespace
function k8s_context() {
if [[ -v $DISABLE_KUBECTL_PROMPT ]]; then
return
fi
if [[ -n $ZSH_KUBECTL_PROMPT ]] then
echo "%{$FX[reset]%}%{$FG[$BLUE]%}%{$FX[reset]%} %{$FG[$GREY]%}$ZSH_KUBECTL_PROMPT%{$FX[reset]%}"
echo "\r\n"
fi
}
# Gcloud account / project
function gcloud_context() {
if [[ -v $DISABLE_GCLOUD_PROMPT ]]; then
return
fi
if [[ -n $ZSH_GCLOUD_PROMPT ]] then
echo "%{$FX[reset]%}%{$FG[$BLUE]%}%{$FX[reset]%} %{$FG[$GREY]%}$ZSH_GCLOUD_PROMPT%{$FX[reset]%}"
echo "\r\n"
fi
}
# Virtualenv
function virtualenv_info {
if [[ -n $VIRTUAL_ENV ]] then
echo "%{$FX[reset]%} `basename $VIRTUAL_ENV`%{$FX[reset]%} %{$FG[$MAGENTA]%}%{$FX[reset]%}"
fi
}
# Go Version
function go_version {
if (( $+commands[go] )); then
VER=$(go version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/')
echo " %{$FX[reset]%}%{$FG[$BLUE]%}%{$FX[reset]%} $VER"
fi
}
# Return Status Hinting
RET_STATUS="%(?:%{$FG[$GREEN]%}➜:%{$FG[$RED]%}➜)%{$FX[reset]%}"
# Git Prompt
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[$BLUE]%}%{$FX[reset]%} %{$FG[$YELLOW]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$FX[reset]%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$FG[$RED]%}%{$FX[reset]%}"
# Default Prompt
PROMPT='$(gcloud_context)$(k8s_context)$(user)$(go_version)
$(git_prompt_info)$RET_STATUS '