Add support for Zim duration-info module
This commit is contained in:
parent
1c3da8df45
commit
f7ebd0e09d
@ -1,5 +1,6 @@
|
|||||||
# -*-mode: sh-*-
|
# -*-mode: sh-*-
|
||||||
# My mess of various themes
|
# My mess of various themes
|
||||||
|
# Optionally uses Zim modules git-info and duration-info
|
||||||
|
|
||||||
setopt nopromptbang promptcr promptpercent promptsp promptsubst
|
setopt nopromptbang promptcr promptpercent promptsp promptsubst
|
||||||
|
|
||||||
@ -32,10 +33,17 @@ if (( ${+functions[git-info]} )); then
|
|||||||
autoload -Uz add-zsh-hook && add-zsh-hook precmd git-info
|
autoload -Uz add-zsh-hook && add-zsh-hook precmd git-info
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (( ${+functions[duration-info-preexec]} )); then
|
||||||
|
zstyle ':zim:duration-info' threshold 1
|
||||||
|
zstyle ':zim:duration-info' format '(%d) '
|
||||||
|
add-zsh-hook preexec duration-info-preexec
|
||||||
|
add-zsh-hook precmd duration-info-precmd
|
||||||
|
fi
|
||||||
|
|
||||||
# Define prompts.
|
# Define prompts.
|
||||||
local userHost='%B%(!.%F{red}.%F{green})%n@${SSH_CLIENT:+%F{blue\}}%m%f%b' # user@host
|
local userHost='%B%(!.%F{red}.%F{green})%n@${SSH_CLIENT:+%F{blue\}}%m%f%b' # user@host
|
||||||
local pathString='%F{cyan}%$((($COLUMNS-20) / 4 ))<..<%~%f' # /path/to/wd
|
local pathString='%F{cyan}%$((($COLUMNS-20) / 4 ))<..<%~%f' # /path/to/wd
|
||||||
local gitInfo='${(e)git_info[prompt]}' # branch:action
|
local gitInfo='${(e)git_info[prompt]}' # branch:action
|
||||||
local promptChar='%B%(!.%F{red}.%F{cyan})${PREFIX}%f%b'
|
local promptChar='%B%(!.%F{red}.%F{cyan})${PREFIX}%f%b'
|
||||||
PS1="$userHost $pathString$gitInfo$promptChar "
|
PS1="$userHost $pathString$gitInfo$promptChar "
|
||||||
RPS1='${editor_info[overwrite]}%(?:: %F{red}%?'$ERROR_CHAR'%f) ${(e)git_info[rprompt]}'
|
RPS1='${editor_info[overwrite]}%(?:: %F{red}%?'$ERROR_CHAR'%f) ${duration_info}${(e)git_info[rprompt]}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user