-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt.zsh
28 lines (21 loc) · 720 Bytes
/
prompt.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
autoload -Uz vcs_info
local mark='*'
zstyle ':vcs_info:*' stagedstr "%F{28}$mark"
zstyle ':vcs_info:*' unstagedstr "%F{11}$mark"
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
zstyle ':vcs_info:*' enable git
parse_ssh_connection() {
[[ -n $SSH_CONNECTION ]] && echo "%n@%m "
}
precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats ' %F{yellow}%b%c%u%F{blue}'
} else {
zstyle ':vcs_info:*' formats " %F{yellow}%b%c%u%F{red}$mark%F{blue}"
}
vcs_info
}
PROMPT='
$(parse_ssh_connection)%F{blue}%c%f%(1j.%F{magenta} %j%f.)%F{yellow} ⌁%f '
RPROMPT='%F{blue}${vcs_info_msg_0_}%f'