Clean up zshrc; add comments

This commit is contained in:
Eryn Wells 2012-04-16 12:19:58 -07:00
parent 6f75e6798d
commit ce63e3f83c

42
zshrc
View file

@ -1,6 +1,13 @@
# .zshrc # .zshrc
# vim: ft=zsh
#
# ZSH init for interactive shells
#
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
# load bash/zsh/ksh agnostic configurations
source $HOME/.rc
# PROMPT # PROMPT
# ' histnum bgjobsflag time (%|#)' # ' histnum bgjobsflag time (%|#)'
# Colors are determined based on zsh capability (>= version 4.3.7) # Colors are determined based on zsh capability (>= version 4.3.7)
@ -16,12 +23,6 @@ else
bgjob="%(1j.%{$fg_bold[magenta]%}* %{$reset_color%}.)" bgjob="%(1j.%{$fg_bold[magenta]%}* %{$reset_color%}.)"
hist="%(0?.%h.%{$fg_bold[red]%}%h%{$reset_color%})" hist="%(0?.%h.%{$fg_bold[red]%}%h%{$reset_color%})"
isroot="%(!.%{$fg_bold[red]%}%#%{$reset_color%}.%#)" isroot="%(!.%{$fg_bold[red]%}%#%{$reset_color%}.%#)"
# where do I include these?
#bgjob="%(1j.%B*%b.)"
#cmdstat="%(0?..%B!%b)"
#isroot="%(!.%B#%b.)"
#mytime="%T"
fi fi
PROMPT=" $hist $bgjob$isroot " PROMPT=" $hist $bgjob$isroot "
@ -77,9 +78,6 @@ setopt \
EXTENDED_GLOB \ EXTENDED_GLOB \
MULTIOS MULTIOS
# load bash/zsh/ksh agnostic configurations
source $HOME/.rc
alias pd='pushd' alias pd='pushd'
alias pod='popd' alias pod='popd'
@ -111,16 +109,21 @@ HISTFILE="$HOME/.zhistory"
#[ -n "$DISPLAY" ] && alias -s pdf='evince' #[ -n "$DISPLAY" ] && alias -s pdf='evince'
#[ -n "$DISPLAY" ] && alias -s dvi='evince' #[ -n "$DISPLAY" ] && alias -s dvi='evince'
# host specific initialization # Set up dircolors
[ -e $HOME/.zshrc-local ] && . ~/.zshrc-local if [ -e $HOME/.dircolors/$sys.cfg ]; then
dircolors=$HOME/.dircolors/$sys.cfg
else
dircolors=$HOME/.dircolors/default.cfg
fi
eval `dircolors $dircolors`
# emacs command line editing # emacs command line editing
bindkey -v bindkey -v
# ###
# Completion # Completion
# ###
# load completion system # load completion system
autoload -U compinit autoload -U compinit
@ -158,8 +161,11 @@ fpath=($HOME/.zsh/func $fpath)
# Wikipedia lookup, courtesy of msanders@github # Wikipedia lookup, courtesy of msanders@github
autoload wiki autoload wiki
# Make a Maildir
autoload mkmdir autoload mkmdir
# Generate a password
autoload pw autoload pw
# Make a C module (.c and .h pair)
autoload mkcmod autoload mkcmod
# Go up $1 directories, where $1 is an integer (saves me from having to type ../ # Go up $1 directories, where $1 is an integer (saves me from having to type ../
@ -178,11 +184,5 @@ function up {
} }
# Toggle showing a separator before every command [ -e $HOME/.zshrc.$SYS ] && source $HOME/.zshrc.$SYS
function tsep { [ -e $HOME/.zshrc.local ] && source $HOME/.zshrc.local
if (($precmd_functions[(Ie)precmd_separator] > 0)); then
precmd_functions=${precmd_functions#precmd_separator}
else
precmd_functions+=(precmd_separator)
fi
}