-
Notifications
You must be signed in to change notification settings - Fork 0
/
typo.zsh-theme
63 lines (53 loc) · 1.87 KB
/
typo.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
# ____ ____ ____ ____
# ||t |||y |||p |||o ||
# ||__|||__|||__|||__||
# |/__\|/__\|/__\|/__\|
#
# A minimal, informative zsh prompt theme
#
# git status variables
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}-> %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[cyan]%} +"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%} !"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%} —"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[green]%} »"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[white]%} #"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[blue]%} ?"
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg_bold[yellow]%} $"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[blue]%} •|"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[blue]%} |•"
# git status display
local git_info='$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
# current user and hostname
local user_host='%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[yellow]%}%m %{$reset_color%}'
# default: blue, if return code other than 0: red
local prompt='%(?,%{$fg[blue]%}> ,%{$fg[red]%}> )'
# current directory display
local directory_path='%{$fg[magenta]%} %c%{$reset_color%}'
# clock
local clock=' %{$fg[blue]%}[%D{%H:%M:%S}]%{$reset_color%}'
# last command return code
local return_code='%(?,,%{$fg[red]%} RC=%?%{$reset_color%})'
# distinction between single and multiline prompt
# activate multiline with TYPEWRITTEN_MULTILINE=true
if [ "$TYPEWRITTEN_MULTILINE" = true ]; then
# left prompt definition (multiline)
PROMPT="${user_host}
${prompt}"
else
# left prompt definition (singleline)
PROMPT="${prompt}"
fi
# right prompt definition
RPROMPT="${directory_path}"
RPROMPT+="${git_info}"
RPROMPT+="${return_code}"
#RPROMPT+="${clock}"
# prompt cursor fix when exiting vim
_fix_cursor() {
echo -ne "\e[3 q"
}
precmd_functions+=(_fix_cursor)