-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzsh_theme
60 lines (48 loc) · 1.56 KB
/
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
# vim:ft=zsh ts=2 sw=2 sts=2
function git_current_branch() {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$(command git describe HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null) || return
fi
echo "${ref#refs/heads/} "
}
# ls colors
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
#export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]
then
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
fi
setopt prompt_subst
typeset -Ag FG BG
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
PROMPT='
%{$BG[000]%}%{$FG[208]%}%m:%{$FG[076]%}${PWD/#$HOME/~}%{$reset_color%}%{$BG[000]%} %{$(git_current_branch)%}%{$FG[242]%}%* ₹%{$reset_color%}
$ '
# light
PROMPT='
%{$BG[000]%}%{$FG[208]%}%{$FG[076]%}${PWD/#$HOME/~}%{$reset_color%}%{$BG[000]%} %{$(git_current_branch)%}%{$FG[242]%}%{$reset_color%}
$ '
# for recording
#PROMPT='
#%{$BG[000]%}%{$FG[208]%}%{$FG[076]%}${PWD/#$HOME/~}%{$reset_color%}%{$BG[000]%}%{$FG[242]%}%{$reset_color%} $ '
ZSH_THEME_GIT_PROMPT_PREFIX=" @ %{$FG[208]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
#RPROMPT='%{$FG[010]%}$(rbenv_version)%{$reset_color%}'