-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdarksoku.zsh-theme
73 lines (58 loc) · 2.04 KB
/
darksoku.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
72
73
# Define colors
local light_green="%{$FG[154]%}"
local green="%{$fg_bold[green]%}"
local red="%{$fg_bold[red]%}"
local cyan="%{$fg_bold[cyan]%}"
local yellow="%{$fg_bold[yellow]%}"
local blue="%{$fg_bold[blue]%}"
local magenta="%{$fg_bold[magenta]%}"
local white="%{$fg_bold[white]%}"
local reset="%{$reset_color%}"
local -a color_array
color_array=($light_green $green $red $cyan $yellow $blue $magenta $white)
# Directory info.
dir() {
[[ -n $1 ]] && echo -n $1
}
# Dir: current working directory
prompt_dir() {
# only print current working directory
# dir '%1~'
# print nearly 3-level working directory
dir '%3~'
# show absolute working directory
# dir '%~'
}
local username_normal_color=$light_green
local username_root_color=$red
local hostname_normal_color=$light_green
local hostname_root_color=$red
local -a username_color
username_color=%(!.$username_root_color.$username_normal_color)
local -a hostname_color
hostname_color=%(!.$hostname_root_color.$hostname_normal_color)
local username_command="%n"
local hostname_command="%m"
local username_output="%(!..$username_color$username_command$reset@)"
local hostname_output="$hostname_color$hostname_command$reset"
local current_dir=$(prompt_dir)
# ret status
local ret_status="(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
# VCS
YS_VCS_PROMPT_PREFIX="%{$fg_bold[white]%}[%{$reset_color%}%{$fg_bold[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$fg_bold[white]%}]%{$reset_color%} "
YS_VCS_PROMPT_DIRTY=" %{$fg_bold[red]%}✗"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}√"
# Git info.
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="$YS_VCS_PROMPT_PREFIX"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
# Prompt format: # DIRECTORY [GIT_BRANCH STATE GIT_SHA] [TIME] \n ➜
PROMPT="%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
$username_output$hostname_output: \
%{$terminfo[bold]$fg[yellow]%}${current_dir} %{$reset_color%}\
${git_info}\
%{$fg[white]%}[%*]
%${ret_status}%{$reset_color%}"