From 11043de68322ce2e21b2daba99a190cc8ae9c90c Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 11 Jul 2013 13:48:42 +0200 Subject: [PATCH] comments consistency --- prompt.zsh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/prompt.zsh b/prompt.zsh index 5fa4a17..bbed048 100644 --- a/prompt.zsh +++ b/prompt.zsh @@ -4,10 +4,10 @@ # MIT License -# Change this to your own username +# change this to your own username DEFAULT_USERNAME='sindresorhus' -# Threshold (sec) for showing cmd exec time +# threshold (sec) for showing cmd exec time CMD_MAX_EXEC_TIME=5 @@ -32,10 +32,11 @@ zstyle ':vcs_info:git*' actionformats ' %b|%a' # enable prompt substitution setopt PROMPT_SUBST -# Only show username if not default +# only show username if not default [ $USER != $DEFAULT_USERNAME ] && local username='%n@%m ' -# Fastest possible way to check if repo is dirty + +# fastest possible way to check if repo is dirty git_dirty() { # check if we're in a git repo command git rev-parse --is-inside-work-tree &>/dev/null || return @@ -43,7 +44,7 @@ git_dirty() { command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo '*' } -# Displays the exec time of the last command if set threshold was exceeded +# displays the exec time of the last command if set threshold was exceeded cmd_exec_time() { local stop=`date +%s` local start=${cmd_timestamp:-$stop} @@ -57,13 +58,13 @@ preexec() { precmd() { vcs_info - # Add `%*` to display the time + # add `%*` to display the time print -P '\n%F{blue}%~%F{236}$vcs_info_msg_0_`git_dirty` $username%f %F{yellow}`cmd_exec_time`%f' - # Reset value since `preexec` isn't always triggered + # reset value since `preexec` isn't always triggered unset cmd_timestamp } -# Prompt turns red if the previous command didn't exit with 0 +# prompt turns red if the previous command didn't exit with 0 PROMPT='%(?.%F{magenta}.%F{red})❯%f ' -# Can be disabled: +# can be disabled: # PROMPT='%F{magenta}❯%f '