.zshrc

[code]
#
# Carlos Macasaet's ZSH Configuration
# http://www.carlos-m.net/
#

# some global options
setopt KSH_GLOB
setopt SH_GLOB
setopt NO_BARE_GLOB_QUAL
setopt GLOB_SUBST
setopt NO_HUP
setopt AUTO_CD
setopt CD_ABLE_VARS

# set environment
export EDITOR=/usr/bin/vim
export VISUAL=$EDITOR
export FCEDIT=$EDITOR
export PAGER=/usr/bin/less

export TMPDIR=$HOME/tmp

umask 022

# set path and manpath
path=( $HOME/bin $HOME/usr/bin /usr/local/bin
/bin /usr/bin /usr/X11R6/bin /usr/games /usr/lib/nmh
/sbin /usr/sbin)
manpath=($manpath $HOME/usr/man)
typeset -U path manpath

# set prompt
if [[ $USER == 'root' ]]; then
PROMPTSUFFIX='#'
else
PROMPTSUFFIX='$'
fi
setopt PROMPT_PERCENT
PS1="%m$PROMPTSUFFIX " #prints hostname$ or hostname#
RPS1='(%*)' #prints current time on right

# history options
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
HISTSIZE=100
SAVEHIST=100
HISTFILE=$HOME/logs/zsh_history

# Autocomplete for current dir on filetypes
compctl -g '*.Z *.gz *.tgz' + -g '*' zcat gunzip
compctl -g '*.tar.Z *.tar.gz *.tgz *.tar.bz2' + -g '*' tar
compctl -g '*.zip *.ZIP' + -g '*' unzip zip
compctl -g '*.(mp3|MP3|ogg|OGG)' + -g '*(-/)' mpg123 xmms

# Autocomplete hosts
hosts=(sol.galaxy.acm.jhu.edu fomalhaut.galaxy.acm.jhu.edu
castor.galaxy.acm.jhu.edu betelguese.galaxy.acm.jhu.edu
jhuniverse.jhu.edu hops.cs.jhu.edu barley.cs.jhu.edu
ugrad1.cs.jhu.edu ugrad2.cs.jhu.edu ugrad3.cs.jhu.edu
ugrad4.cs.jhu.edu ugrad4.cs.jhu.edu ugrad5.cs.jhu.edu
ugrad6.cs.jhu.edu ugrad7.cs.jhu.edu ugrad8.cs.jhu.edu
ugrad9.cs.jhu.edu ugrad10.cs.jhu.edu ugrad11.cs.jhu.edu
ugrad12.cs.jhu.edu ugrad13.cs.jhu.edu ugrad14.cs.jhu.edu
ugrad15.cs.jhu.edu ugrad16.cs.jhu.edu ugrad17.cs.jhu.edu)
compctl -k hosts ssh scp ping host

# Autocomplete MH folders
mhfolders=(`folders -fast | awk '{ print "+"$1 }'`)
compctl -k mhfolders folder scan refile flist show rmm repl forw

# write/talk completion
function whoson { reply=(`users`); }
compctl -K whoson talk ytalk write finger

# Usage: pskill pskill() {
kill -9 $(ps -aux | grep $1 | grep -v grep | awk '( print $1 )')
echo -n "Killed $1 process..."
}

alias logoot='logout'
alias feline='cat'
alias ls='ls --color'
alias ll='ls --color -l'
alias md='mkdir'

# watch for friends
watch=( $(<$HOME/etc/watchlist) )
LOGCHECK=60
WATCHFMT='%n %a'

export PGHOST=localhost
[/code]

Leave a Reply