Skip to content

Commit

Permalink
Merge pull request ryanoasis#20 from dritter/dritter/date_configurable
Browse files Browse the repository at this point in the history
Better configurability of time format
  • Loading branch information
bhilburn committed Apr 3, 2015
2 parents b1d6d3e + 367c354 commit 56dc536
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 56dc536

Please sign in to comment.