-
Notifications
You must be signed in to change notification settings - Fork 0
/
jlucier.zsh-theme
62 lines (53 loc) · 1.96 KB
/
jlucier.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
# af-magic.zsh-theme
#
# Author: Andy Fleming
# URL: http://andyfleming.com/
# dashed separator size
function afmagic_dashes {
# check either virtualenv or condaenv variables
local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
# if there is a python virtual environment and it is displayed in
# the prompt, account for it when returning the number of dashes
if [[ -n "$python_env" && "$PS1" = \(* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
else
echo $COLUMNS
fi
}
if [[ "$OSTYPE" == "darwin"* ]]; then
os=""
elif [ -f "/etc/fedora-release" ]; then
oscolor=116
os=""
else
oscolor=208
os=""
fi
SEGMENT_SEPARATOR=$'\ue0b0'
# primary prompt: dashed separator, directory and vcs info
PS1="${FG[238]}\${(l.\$(afmagic_dashes)..-.)}%{$reset_color%}
╭─ ${FG[$oscolor]}$os%{$reset_color%} %m ${FG[153]}%~\$(git_prompt_info)\$(hg_prompt_info)%{$reset_color%}
╰─ ${FG[177]}%(!.#.»)%{$reset_color%} "
PS2="%{$fg[red]%}\ %{$reset_color%}"
# right prompt: return code, virtualenv and context (user@host)
RPS1="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if (( $+functions[virtualenv_prompt_info] )); then
RPS1+='$(virtualenv_prompt_info)'
fi
RPS1+=" ${FG[240]}%*%{$reset_color%}"
# git settings
ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[075]}(${FG[156]}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[cyan]%}▴%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[magenta]%}▾%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="${FG[214]}±%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="${FG[075]})%{$reset_color%}"
# hg settings
ZSH_THEME_HG_PROMPT_PREFIX=" ${FG[075]}(${FG[078]}"
ZSH_THEME_HG_PROMPT_CLEAN=""
ZSH_THEME_HG_PROMPT_DIRTY="${FG[214]}*%{$reset_color%}"
ZSH_THEME_HG_PROMPT_SUFFIX="${FG[075]})%{$reset_color%}"
# virtualenv settings
ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[075]}["
ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}"