96148d2275b848dbfb976a58967535067def4210

Author
Robert Strack <robert.strack@gmail.com>
Committer
Robert Strack <robert.strack@gmail.com>
Date

Message

customizable timer format

Diff

 1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
 2index 33481ea4e8f5a6defceec7e87618059213580af7..f7f039b7825a1c358b351059ecdb743b302eaaa8 100644
 3--- a/plugins/timer/timer.plugin.zsh
 4+++ b/plugins/timer/timer.plugin.zsh
 5@@ -6,7 +6,8 @@ __timer_format_duration() {
 6   local mins=$(printf '%.0f' $(($1 / 60)))
 7   local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
 8   local duration_str=$(echo "${mins}m${secs}s")
 9-  echo "${TIMER_SYMBOL:-\`}${duration_str#0m}"
10+  local format="${TIMER_FORMAT:-/%d}"
11+  echo "${format//\%d/${duration_str#0m}}"
12 }
13 
14 preexec() {