mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
Add ability to show 24 hour format
#Set ISO8601_HOURS to any string or value to get a 24-hour clock #If ISO8601_HOURS is unset show 12-hour clock #export before loading theme export ISO8601_HOURS=1 ZSH_THEME="rkj-repos"
This commit is contained in:
parent
f94d4e6a40
commit
fc04be81ec
1 changed files with 9 additions and 1 deletions
|
|
@ -27,10 +27,18 @@ function mygit() {
|
|||
fi
|
||||
}
|
||||
|
||||
function hour_format() {
|
||||
if [[ -z "${ISO8601_HOURS+x}" ]]; then
|
||||
echo "%I"
|
||||
else
|
||||
echo "%H"
|
||||
fi
|
||||
}
|
||||
|
||||
function retcode() {}
|
||||
|
||||
# alternate prompt with git & hg
|
||||
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
|
||||
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d $(hour_format):%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
|
||||
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b '
|
||||
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue