commit 1cf8d402bacdae5132da87d697177e0b241bbd97
parent a4a5f21fc5d0d29c24a78ef2a80ee81e1cb41463
Author: Chris Bracken <cbracken@shachi.(none)>
Date: Sat, 20 Oct 2012 12:36:00 -0700
zsh compatibility
Diffstat:
5 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/.bash_aliases b/.aliases
diff --git a/.bashrc b/.bashrc
@@ -37,11 +37,8 @@ case "$TERM" in
xterm-color) color_prompt=yes;;
esac
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
+# uncomment for a colored prompt, if the terminal has the capability.
force_color_prompt=yes
-
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
@@ -69,8 +66,8 @@ xterm*|rxvt*)
;;
esac
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
+if [ -f ~/.aliases ]; then
+ . ~/.aliases
fi
# enable programmable completion features (you don't need to enable
diff --git a/.profile b/.profile
@@ -10,15 +10,17 @@ umask 022
export EDITOR=/usr/bin/vim
-# if running bash
if [ -n "$BASH_VERSION" ]; then
- # include .bashrc if it exists
- if [ -f "$HOME/.bashrc" ]; then
- . "$HOME/.bashrc"
- fi
+ # bash doesn't read .bashrc in login shells, do it manually
+ if [ -f "$HOME/.bashrc" ]; then
+ . "$HOME/.bashrc"
+ fi
fi
# set PATH so it includes user's private bin if it exists
-if [ -d "$HOME/bin" ] ; then
- PATH="$HOME/bin:$PATH"
-fi
+[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"
+
+# update PATH variable for use with MacPorts
+[ -d /opt/local/sbin ] && PATH="/opt/local/sbin:$PATH"
+[ -d /opt/local/bin ] && PATH="/opt/local/bin:$PATH"
+[ -d /opt/local/libexec/gnubin ] && PATH="/opt/local/libexec/gnubin:$PATH"
diff --git a/.zprofile b/.zprofile
@@ -0,0 +1,5 @@
+# .zprofile
+
+emulate sh
+. ~/.profile
+emulate zsh
diff --git a/.zshrc b/.zshrc
@@ -0,0 +1,45 @@
+# history
+HISTFILE=~/.histfile
+HISTSIZE=1000
+SAVEHIST=1000
+setopt appendhistory
+
+# extended glob
+setopt extendedglob
+
+# vi-mode
+bindkey -v
+
+# completion
+zstyle :compinstall filename '/Users/cbracken/.zshrc'
+autoload -Uz compinit && compinit
+zstyle ':completion:*' menu select
+
+# prompt
+autoload -Uz colors && colors
+
+# uncomment for a colored prompt, if the terminal has the capability
+force_color_prompt=yes
+if [ -n "$force_color_prompt" ]; then
+ if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+ # We have color support; assume it's compliant with Ecma-48
+ # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+ # a case would tend to support setf rather than setaf.)
+ color_prompt=yes
+ else
+ color_prompt=
+ fi
+fi
+
+if [ "$color_prompt" = yes ]; then
+ PROMPT="%{$fg[yellow]%}%T %{$fg[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%c%{$reset_color%}%# "
+else
+ PROMPT="%T %n@%m:%c%# "
+fi
+unset color_prompt force_color_prompt
+
+# Aliases
+if [ -f ~/.aliases ]; then
+ . ~/.aliases
+fi
+