-
Notifications
You must be signed in to change notification settings - Fork 0
/
shini.zsh-theme
45 lines (37 loc) · 1.09 KB
/
shini.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
# shini v1.1 - a minimal zsh prompt
# username, with hostname
# ex. luigi@homepc
userathost() {
echo "%F{red}%n@%m%f"
}
# directory, with ~ alias
# ex. ~/test, /opt/homebrew
directory() {
echo "%F{cyan}${PWD/#$HOME/~}%f"
}
# git branch setup
# ex. (master*) dirty branch
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
ZSH_THEME_GIT_PROMPT_DIRTY="*"
ZSH_THEME_GIT_PROMPT_CLEAN="/"
# All of these variables are empty by default, but can be set in your theme similar to above:
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+%f"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}=%f"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-%f"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}^%f"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}!%f"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}@%f"
# time
# ex. 12:23AM
curtime() {
echo "%t"
}
# exit status (green o for good, red x for fail)
# ex. look here for result
failstat() {
echo "%(?.%{$fg[green]%}O%f.%{$fg[red]%}X%f)"
}
setopt PROMPT_SUBST
PROMPT='$(directory) $(git_prompt_info) %#> '
RPROMPT='$(userathost), $(curtime), $(failstat)'