-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpronto.zsh-theme
37 lines (28 loc) · 934 Bytes
/
pronto.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
#!/bin/zsh
autoload -Uz add-zsh-hook edit-command-line
setopt prompt_subst
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '|+'
zstyle ':vcs_info:*' stagedstr '|*'
zstyle ':vcs_info:git:*' formats '(%b%m%u%c) '
zstyle ':vcs_info:git:*' actionformats '(%b%u%c|%a) '
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
function +vi-git-untracked() {
if [[ -n $(git status --porcelain 2>/dev/null | grep '^??') ]]; then
hook_com[misc]+='|!'
fi
}
function vi-mode-color() {
if [[ $KEYMAP == vicmd ]]; then
PROMPT='%F{green}%~ %F{magenta}${vcs_info_msg_0_}%F{yellow}%F{blue}%#%f '
else
PROMPT='%F{green}%~ %F{magenta}${vcs_info_msg_0_}%F{yellow}%#%f '
fi
zle reset-prompt
}
zle -N edit-command-line
zle -N zle-line-init vi-mode-color
zle -N zle-keymap-select vi-mode-color
bindkey -M vicmd ! edit-command-line