about summary refs log tree commit diff
path: root/users/fcuny/configs/zsh/init.zsh
blob: 1dba48e03c6a356176e2ae4df114b7871dcca7ea (plain) (blame)
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
# Print timing statistics for everything which takes longer than 5 seconds of
# user + system time ('sleep 6' does not work because of 0% user/system time!).
REPORTTIME=5

autoload -U colors && colors

autoload -Uz vcs_info add-zsh-hook
setopt prompt_subst

add-zsh-hook precmd vcs_info
# Enable checking for (un)staged changes, enabling use of %u and %c
zstyle ':vcs_info:*' check-for-changes true
# Set custom strings for an unstaged vcs repo changes (*) and staged changes (+)
zstyle ':vcs_info:*' unstagedstr "%F{yellow}●%f"
zstyle ':vcs_info:*' stagedstr   "%F{green}●%f"
# Set the format of the Git information for vcs_info
zstyle ':vcs_info:git:*' formats       " (%b%c%u)"
zstyle ':vcs_info:git:*' actionformats " (%b|%a%u%c)"

PROMPT='%K{cyan}%F{black}%m%k%f %~%F{red}${vcs_info_msg_0_}%f %# '

# For tramp (emacs).
if [ "$TERM" = "dumb" ]; then
  unset PROMPT
  PS1='$ '
  unsetopt zle
fi