Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
de8d6841
Commit
de8d6841
authored
Nov 18, 2015
by
Robert Strack
Browse files
added pre_functions
parent
96148d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/timer/timer.plugin.zsh
View file @
de8d6841
...
...
@@ -10,11 +10,11 @@ __timer_format_duration() {
echo
"
${
format
//\%d/
${
duration_str
#0m
}}
"
}
preexec
()
{
__timer_save_time_
preexec
()
{
__timer_cmd_start_time
=
$(
__timer_current_time
)
}
precmd
()
{
__timer_display_timer_
precmd
()
{
if
[
-n
"
${
__timer_cmd_start_time
}
"
]
;
then
local
cmd_end_time
=
$(
__timer_current_time
)
local
tdiff
=
$((
cmd_end_time
-
__timer_cmd_start_time
))
...
...
@@ -24,3 +24,6 @@ precmd() {
echo
-e
"
\0
33[1A
\0
33[
${
cols
}
C
${
tdiffstr
}
"
fi
}
preexec_functions+
=(
__timer_save_time_preexec
)
precmd_functions+
=(
__timer_display_timer_precmd
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment