编辑~/.zshrc文件

在最后加上:

local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
RPROMPT="%D{%y/%m/%d} %D{%H:%M:%S}"

zsh-datetime.png
你也可以更改时间戳格式:

 %D     The date in yy-mm-dd format.
 %T     Current time of day, in 24-hour format.
 %t %@  Current time of day, in 12-hour, am/pm format.
 %*     Current time of day in 24-hour format, with seconds.
 %w     The date in day-dd format.
 %W     The date in mm/dd/yy format.
 %D{strftime-format}
0条评论 顺序楼层
请先登录再回复