mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
Merge pull request #20 from dritter/dritter/date_configurable
Better configurability of time format
This commit is contained in:
commit
56dc536f6c
2 changed files with 14 additions and 1 deletions
|
@ -109,6 +109,14 @@ elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`:
|
||||||
|
|
||||||
export DEFAULT_USER=<your username>
|
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
|
#### The VCS Information Segment
|
||||||
|
|
||||||
By default, the `vcs` segment will provide quite a bit of information. If you
|
By default, the `vcs` segment will provide quite a bit of information. If you
|
||||||
|
|
|
@ -301,7 +301,12 @@ prompt_longstatus() {
|
||||||
|
|
||||||
# System time
|
# System time
|
||||||
prompt_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)
|
# Command number (in local history)
|
||||||
|
|
Loading…
Reference in a new issue