-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhacknut.zsh-theme
More file actions
35 lines (28 loc) · 1.09 KB
/
hacknut.zsh-theme
File metadata and controls
35 lines (28 loc) · 1.09 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
function ruby_prompt {
which rvm-prompt &> /dev/null && echo $(rvm-prompt i v g) && return
which rbenv &> /dev/null && echo $(rbenv version | sed -e "s/ (set.*$//") && return
}
DISABLE_UNTRACKED_FILES_DIRTY="false"
ZSH_THEME_PROMPT_SEPARATOR="%{$reset_color%}%{$fg[magenta]%} ¦ %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
# Customized git status
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
echo "$(parse_git_dirty)$(current_branch)$ZSH_THEME_PROMPT_SEPARATOR"
fi
}
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
function hacknut_timestamp {
echo "%{$FX[bold]%}%{$fg[white]%}%*%{$FX[no-bold]%}"
}
function hacknut_dir {
echo "%{$fg[cyan]%}%c% %{$reset_color%}"
}
RPROMPT='%{$reset_color%}$(hacknut_timestamp)$ZSH_THEME_PROMPT_SEPARATOR%{$fg[blue]%}$(ruby_prompt)%{$reset_color%} $EPS1'
PROMPT='$(git_custom_status)$(hacknut_dir)%{$fg[magenta]%}$(prompt_char)%{$reset_color%} '