aboutsummaryrefslogtreecommitdiff
path: root/zsh/appearance.zsh
diff options
context:
space:
mode:
authorMatt Singleton <matthew.j.singleton@gmail.com>2011-03-11 14:58:30 -0500
committerMatt Singleton <matthew.j.singleton@gmail.com>2011-03-11 14:58:30 -0500
commit7ced7d75f22746ed2e94cadebf21a515eb2a8a8d (patch)
tree8aa6c59a0b9e5574b95e0fd0d30cd13a5322ff08 /zsh/appearance.zsh
parentc2d7de102781a8528966c881feb4bb3a0798e238 (diff)
just changing some comments
Diffstat (limited to 'zsh/appearance.zsh')
-rw-r--r--zsh/appearance.zsh24
1 files changed, 15 insertions, 9 deletions
diff --git a/zsh/appearance.zsh b/zsh/appearance.zsh
index ffe391c..1100c43 100644
--- a/zsh/appearance.zsh
+++ b/zsh/appearance.zsh
@@ -1,15 +1,15 @@
-autoload colors; colors;
-setopt prompt_subst # enable expansion of color codes, etc. in the prompt
+#
+# colorize shell programs
-# Find the option for using colors in ls, depending on the version: Linux or BSD
+# ls (platform dependent)
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
export LSCOLORS="exgxbxdxcxegedxbxgxcxd"
-# enable colorful grep output
+# grep
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'
-# enable colorful less output
+# less
export LESS_TERMCAP_mb=$'\e[0;31m' # begin blinking - red
export LESS_TERMCAP_md=$'\e[0;34m' # begin bold - blue
export LESS_TERMCAP_me=$'\e[0m' # end mode
@@ -18,13 +18,19 @@ export LESS_TERMCAP_se=$'\e[0m' # end standout mode
export LESS_TERMCAP_us=$'\e[4;33m' # begin underline - yellow underline
export LESS_TERMCAP_ue=$'\e[0m' # end underline
+#
+# make a sweet prompt
+
+autoload colors; colors;
+setopt prompt_subst # expansion of color codes, etc. in the prompt
+
# print the fully resolved shell command with time stamp
# to be run from zsh's builtin 'preexec' with all arguments passed through ($*)
function theme_preexec () {
echo "($fg[magenta]`date +%r`$reset_color) $fg[cyan]$3$reset_color"
}
-# print the exit code in red if nonzero
+# print the exit code of the previous command in red if non-zero
function return_code {
code=$(echo $?)
if [[ $code == "0" ]]; then
@@ -34,20 +40,20 @@ function return_code {
fi
}
-# print the svn revision number when in an svn repo (rREVISION)
+# print the svn revision number (rREVISION)
function svn_prompt_info {
info=$(svn info 2>/dev/null) || return
rev=$(echo "$info" | grep Revision | sed 's/Revision: //')
echo "(r${rev}) "
}
-# print the git branch name when in a git repo (BRANCH)
+# print the current git branch (BRANCH)
function git_prompt_info {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "(${ref#refs/heads/}) "
}
-# print a special prompt character depending on the vcs of the current dir
+# print a special prompt char in version controlled directories
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
svn info >/dev/null 2>/dev/null && echo 'ϟ' && return