1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-12 00:00:07 +00:00

Merge pull request #20 from dritter/dritter/date_configurable

Better configurability of time format
This commit is contained in:
Ben Hilburn 2015-04-03 09:03:52 -07:00
commit 56dc536f6c
2 changed files with 14 additions and 1 deletions

View file

@ -109,6 +109,14 @@ elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`:
export DEFAULT_USER=<your username>
#### The 'time' segment
By default the time is show in 'H:M:S' format. If you want to change it,
just set another format in your `~/.zshrc`:
# Reversed time format
POWERLEVEL9K_TIME_FORMAT='%D{%S:%M:%H}'
#### The VCS Information Segment
By default, the `vcs` segment will provide quite a bit of information. If you

View file

@ -301,7 +301,12 @@ prompt_longstatus() {
# System time
prompt_time() {
$1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR '%D{%H:%M:%S} '
local time_format='%D{%H:%M:%S}'
if [[ -n $POWERLEVEL9K_TIME_FORMAT ]]; then
time_format=$POWERLEVEL9K_TIME_FORMAT
fi
$1_prompt_segment $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$time_format "
}
# Command number (in local history)