-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathThyGoD.zsh
69 lines (58 loc) · 2.09 KB
/
ThyGoD.zsh
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
64
65
66
67
68
69
#!/bin/zsh
# Based on gnzh/bira's code, Inspired by Spaceship.
setopt prompt_subst
() {
local PR_USER PR_USER_OP PR_PROMPT PR_HOST PR_SYMBOL
local USER_SYMBOL ROOT_SYMBOL
# Change these if you want to use other symbols.
# Other Symbols:
# ★ ∴ → ☣ ☢ ▲ ▼
# ❤ ❥ ♥ ♡ ✘ ツ⌘
# € £ ϟ ✿ ❅ © ♚
# ->
USER_SYMBOL='>>>'
ROOT_SYMBOL='💀'
# Check the UID
if [[ $UID -ne 0 ]]; then # normal user
PR_USER='%F{blue}%n%f'
PR_USER_OP='%F{blue}%#%f'
PR_SYMBOL="%B%F{cyan}${USER_SYMBOL}%f"
else # root
PR_USER='%B%F{red}%n%f'
PR_USER_OP='%B%F{red}%#%f'
PR_SYMBOL="${ROOT_SYMBOL}"
fi
# Checks if command has an error code or not.
# Returns green arrow when there is no error.
# Returns red cross when there is an error.
PR_PROMPT="%(?.%B%F{green}→ %f.%B%F{red}⨯ %f)"
# Check if we are on SSH or not
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
PR_HOST='%B%F{blue}%M%f' # SSH
else
PR_HOST='%F{blue}%M%f' # no SSH
fi
# Sets Prompt Variables.
local return_code="%(?..%F{red}%? %f)"
local user_host="${PR_USER}%F{cyan}${PR_SYMBOL}${PR_HOST}"
local current_dir="%B%F{204}%~%f%b"
local git_branch='$(git_super_status)'
# Sets Prompt Layout
NEWLINE=$'\n'
PROMPT="${NEWLINE}${user_host} ${current_dir} ${git_branch} ${NEWLINE}$PR_PROMPT"
RPROMPT="${return_code}"
# Sets Configurations for Plugins.
ZSH_THEME_GIT_PROMPT_PREFIX="%F{123}~["
ZSH_THEME_GIT_PROMPT_SUFFIX="%B%F{135}]%f"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%G%}"
ZSH_THEME_GIT_PROMPT_SEPARATOR="%F{123}]%f%F{250}:%f%B%F{135}["
ZSH_THEME_GIT_PROMPT_BRANCH="%F{123}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg_bold[blue]%}%{✚%G%}"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[blue]%}%{-%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%}%{…%G%}"
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg_bold[blue]%}%{⚑%G%}"
}