source /etc/profile if [ "$TERM" = "xterm" ]; then export TERM="xterm-256color" fi if type -p dircolors >/dev/null; then eval `dircolors -b` fi # Set terminal window title precmd () { [[ -t 1 ]] || return case $TERM in *xterm*|rxvt|rxvt-unicode*|(dt|k|E|a)term) print -Pn "\e]2; %n:%~ \a" ;; screen*) print -Pn "\e\"[ %n:%.% ]\e\134" ;; esac } [[ -t 1 ]] || return case $TERM in *xterm*|rxvt|rxvt-unicode*|(dt|k|E|a)term) preexec () { print -Pn "\e]2; $1 - $TERM \a" } ;; screen*) preexec () { print -Pn "\e\"$1\e\134" } ;; esac ulimit -Sc 0 ulimit -Hc 0 # Prompt PROMPT="%n@%m\$ " RPROMPT=$'%.%' # Exports export HISTFILE=~/.zsh_history export HISTSIZE=1000 export SAVEHIST=1000 export HOSTTYPE="$(uname -m)" export BROWSER=firefox export LESS="-R" export PAGER=less export EDITOR=vim export CVS_RSH=ssh export RSYNC_RSH=ssh export WINEARCH="win32" multi-extract() { for i in $@; do aunpack $i done } # Completion autoload -U compinit promptinit compinit zstyle ':completion::complete:*' use-cache 1 compctl -f -x 'S[1][2][3][4][5][6][7][8][9]' -k '(1 2 3 4 5 6 7 8 9)' \ - 'R[[1-9nlo]|[1-9](|[a-z]),^*]' -K 'match-man' \ - 's[-M],c[-1,-M]' -g '*(-/)' \ - 's[-P],c[-1,-P]' -c \ - 's[-S],s[-1,-S]' -k '( )' \ - 's[-]' -k '(a d f h k t M P)' \ - 'p[1,-1]' -c + -K 'match-man' \ -- man # Aliases alias ls="ls -CFv --color=auto --group-directories-first" alias dir="dir -Cv --color=auto --group-directories-first" alias rrm="/bin/rm" alias exit="clear && exit" alias mplayer="mplayer -stop-xscreensaver" alias updatedb="run_as_root updatedb" alias vim="vim -p -X" # Safety aliases alias cp="cp -i" alias mv="mv -i" alias ln="ln -i" alias chown="chown --preserve-root" alias chmod="chmod --preserve-root" alias chgrp="chgrp --preserve-root" # Key bindings case $TERM in (xterm*|aterm|rxvt|rxvt-unicode*) bindkey "\e[1~" beginning-of-line # Home bindkey "\e[4~" end-of-line # End bindkey "\e[5~" beginning-of-history # PageUp bindkey "\e[6~" end-of-history # PageDown bindkey "\e[2~" quoted-insert # Ins bindkey "\e[3~" delete-char # Del bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\e\e[C" forward-word bindkey "\e\e[D" backward-word bindkey "\e[Z" reverse-menu-complete # Shift+Tab bindkey "\e[7~" beginning-of-line # Home bindkey "\e[8~" end-of-line # End bindkey "\eOH" beginning-of-line bindkey "\eOF" end-of-line bindkey "\e[H" beginning-of-line bindkey "\e[F" end-of-line esac case $TERM in (screen*) bindkey "\e[1~" beginning-of-line # Home bindkey "\e[4~" end-of-line # End bindkey "\e[5~" beginning-of-history # PageUp bindkey "\e[6~" end-of-history # PageDown bindkey "\e[2~" quoted-insert # Ins bindkey "\e[3~" delete-char # Del esac