2020-04-23 15:53:50 -04:00
|
|
|
local current_time="[%B%D{%T}%b]"
|
2015-12-11 00:31:30 -05:00
|
|
|
local current_dir='%B%F{blue}%~%f%b'
|
|
|
|
|
|
|
|
# user
|
|
|
|
local user="%F{green}%n%f"
|
|
|
|
|
|
|
|
# host
|
|
|
|
local host=""
|
|
|
|
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
|
|
|
|
host='%F{yellow}%M%f' #SSH
|
|
|
|
else
|
|
|
|
host='%F{green}%M%f' # no SSH
|
|
|
|
fi
|
|
|
|
|
|
|
|
# vcs
|
|
|
|
precmd() {
|
|
|
|
setopt promptsubst
|
|
|
|
autoload -Uz vcs_info
|
2015-08-01 19:23:27 -04:00
|
|
|
|
2015-12-10 15:46:53 -05:00
|
|
|
zstyle ':vcs_info:*' enable git hg svn
|
2015-12-11 00:31:30 -05:00
|
|
|
zstyle ':vcs_info:*:prompt:*' nvcsformats ""
|
2015-12-11 08:46:13 -05:00
|
|
|
zstyle ':vcs_info:*:prompt:*' formats "[%F{cyan}%b%f%u%c]"
|
2015-08-01 19:23:27 -04:00
|
|
|
vcs_info 'prompt'
|
|
|
|
}
|
2015-12-11 00:31:30 -05:00
|
|
|
local vcs='${vcs_info_msg_0_}'
|
2015-08-01 19:23:27 -04:00
|
|
|
|
2021-04-01 22:16:35 -04:00
|
|
|
local prompt="%B%(?.%F{green}✓%b.%F{red}✗)%b%f"
|
2015-08-01 19:23:27 -04:00
|
|
|
|
2015-12-11 00:31:30 -05:00
|
|
|
PROMPT="${current_time} ${user}@${host} ${current_dir} ${vcs}
|
2021-04-01 22:16:35 -04:00
|
|
|
$prompt "
|