zshrc
Download
Preview
#
# set up some enviroment variables
#
# set the promt
export PROMPT='%n@%m:%~/'
# set default editor to vim
export EDITOR=vim
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:ex=01;32:mi=5;31;46:or=5;31;46:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.deb=01;31:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.ppm=01;35:'
export LC_OPTIONS='--color=auto'
#
# set up some key bindings
#
# fix keybindings
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
# some additional keybindings
bindkey -v '^R' history-incremental-search-backward
#
# set up some important options
#
# enable support for zstyle completition
autoload -U compinit && compinit
# enable and configure the history
setopt append_history # append the history file (!important for using multiple zsh sessions)
setopt SHARE_HISTORY # use commands history files used by different zsh sessions
# enhance usability
setopt notify # immediately report the status of background options
#
# set up the command history
#
HISTFILE="$HOME/.zsh_history"
HISTSIZE=500
SAVEHIST=1000
#
# set up some usefull command alias
#
# shortcut for detailed listing
alias ll='ls -lh'
# screenshooter
alias sshot='import -window root ~/$(whoami)@$(hostname)-$(date +%Y%m%d_%H%M%S).png'
# colored grep
alias grep='grep --color=auto'
#
# setup completion
#
# enable colors
zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS}"
# enable menu style chooser
zstyle ':completion:*' menu select=2
# fault tolerance
zstyle ':completion:*' completer _complete _correct _approximate
zstyle ':completion:*:approximate:*' max-errors 2
# zstyle kill menu
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
# include the local zshrc if exists
if test -s .zshrc_local
then
source .zshrc_local
fi
#
# show small startup greeter using figlet if available
#
myname=`uname -sr`
clear
if which figlet &> /dev/null;
then
if [ ${#myname} -gt 18 ]
then
myname=`uname -sr | cut -c 1-17`'..'
fi
figlet -f small $myname
else
echo $myname
fi
echo '>'`uptime`
eval SMBD=`ps ax | grep -v grep | grep -c smbd`
eval HTTPD=`ps ax | grep -v grep | grep -c httpd`
eval MYSQL=`ps ax | grep -v grep | grep -c mysql`
eval PGSQL=`ps ax | grep -v grep | grep -c postmaster`
echo '> smbd['$SMBD'] :: httpd['$HTTPD'] :: mysql['$MYSQL'] :: pgsql['$PGSQL']'
echo " "