# ---------------------------------------------------------------------- # file: ~/.zshrc # author: Christopher (moparx) - www.linuxinfusion.com # modified: Febuary 02, 2008 22:14:05 # vim:enc=utf-8:ai:si:ts=5:sw=5:et:nu:fdm=indent:fdn=1: # ---------------------------------------------------------------------- # zsh enviroment ------------------------------------------------------- export BROWSER="firefox3" export EDITOR="vim" export VISUAL=$EDITOR export MAIL="~/.mail" export NNTPSERVER="newsgroups.bellsouth.net" export PATH=${PATH}:/usr/local/bin:/usr/local/games # modules -------------------------------------------------------------- zstyle :compinstall filename '/home/moparx/.zshrc' autoload -U colors compinit promptinit colors compinit promptinit; prompt walters zmodload zsh/mathfunc zmodload zsh/complist # terminal ------------------------------------------------------------- if [[ "$TERM" = "rxvt-unicode" ]]; then export TERM="rxvt" fi # set terminal title case $TERM in xterm*|rxvt*|screen) precmd () {print -Pn "\e]0;%n@%m: %~\a"} ;; esac if [[ -f /etc/DIR_COLORS ]]; then eval `dircolors -b /etc/DIR_COLORS` fi # settings ------------------------------------------------------------- bindkey -v bindkey "^r" history-incremental-search-backward umask 077 ulimit -S -c 0 HISTFILE=~/.histfile HISTSIZE=200 SAVEHIST=200 setopt append_history share_history extended_history setopt hist_ignore_all_dups hist_expire_dups_first hist_find_no_dups setopt hist_verify bang_hist hist_ignore_space inc_append_history setopt autopushd pushdminus pushdsilent pushdtohome nopromptcr setopt notify noclobber autolist rcquotes interactivecomments setopt autocd correct correctall extendedglob dvorak globdots setopt alwaystoend completeinword cdablevars chase_links numeric_glob_sort setopt autoresume check_jobs long_list_jobs # completion ----------------------------------------------------------- zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' cache-path ~/.zsh/cache zstyle ':completion:*' _force_rehash zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31" zstyle ':completion:*' list-colors "$LS_COLORS" zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:kill:*' force-list always zstyle ':completion:*:processes' command 'ps -U $(whoami) | sed "/ps/d"' zstyle ':completion:*:processes' insert-ids menu yes select zstyle ':completion:*:functions' ignored-patterns '_*' zstyle -e ':completion:*:approximate:*' \ max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' zstyle ':completion:*' completer _complete _match _approximate zstyle ':completion:*:match:*' original only zstyle ':completion:*:approximate:*' max-errors 1 numeric zstyle ':completion:*' expand 'yes' zstyle ':completion:*' squeeze-slashes 'yes' zstyle ':completion:*' menu select zstyle ':completion:*' verbose yes zstyle ':completion:*:descriptions' format '%B%d%b' zstyle ':completion:*:messages' format '%d' zstyle ':completion:*:warnings' format 'No matches for: %d' zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle ':completion:*' group-name '' zstyle ':completion:*:(cd|mv|cp):*' ignore-parents parent pwd zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes # match uppercase from lowercase zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Add known hosts to SSH completion zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=( ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \ /dev/null)"}%%[# ]*}//,/ } )' zstyle ':completion:*:*:*:users' ignored-patterns \ bin bitlbee daemon dbus fetchmail ftp hal mail mpd nobody \ postfix privoxy sshd tor # aliases -------------------------------------------------------------- alias -s gz="tar -xzvf" alias -s bz2="tar -xjvf" alias -s zip="unzip" alias -s rar="rar x" alias -s {jpg,jpeg,png,gif}="feh --scale-down" alias -s {mp3,ogg,wav,flac}="mplayer" alias -s {mpg,mpeg,avi,ogm,wmv,m4v,mp4,mov,mkv}="mplayer" alias -s {html,php,com,net,org,gov}=$BROWSER alias -s txt=$EDITOR alias -s doc="catdoc" alias -s pdf="epdfview" alias -s xcf="gimp-remote" alias -g ...="../.." alias -g ....="../../.." alias -g .....="../../../.." alias -g L="|less" alias -g G="|grep" alias -g H="|head" alias -g T="|tail" alias -g S="|sort" alias :q="exit" alias :wq="exit" alias bbs="mrxvt --font smoothansi -bg black -fg white -e telnet REMOVED" alias bc="bc -q" alias c='clear' alias cp="nocorrect cp -v" alias du="du -h --max-depth=1" alias df="df -h" alias e=$EDITOR alias grep="grep --color=auto -n" alias h="history" alias ht="htop -u $(whoami) -t" alias j="jobs" alias k="kill" alias l="ls" alias ls="ls -hF --color=auto --group-directories-first" alias mkdir='nocorrect mkdir' alias mv="nocorrect mv -v" alias netstat="netstat -nap --inet" alias nzb="hellanzb.py" alias pgrep="pgrep -l" alias q="exit" alias rm="nocorrect rm -v" alias recent="ls -lAt | head" alias screen="screen -U -R -i" alias ss="scrot %Y-%m-%d_moparx.png -d 8 -c -t 576x230" alias start="dbus-launch startx -nolisten tcp" alias syn="rsync -avz -e ssh --exclude-from=/home/moparx/.rsync/exclude --delete --delete-excluded /home/moparx moparx@REMOVED:/home/moparx/backups" alias today='date "+%A, %d %B, %G%t%H:%M %Z(%z)"' alias urxvt="urxvtc" alias vi="vim" alias vd="vimdiff" # functions ------------------------------------------------------------ bashorg () { w3m -dump "http://www.bash.org/?${1}" |less } makepasswords() { perl <$%&()*^})); for (1..10) { print join "", map { \$a[rand @a] } (1..rand(3)+10); print qq{\n} } EOPERL } _force_rehash() { (( CURRENT == 1 )) && rehash return 1 } src () { autoload -U zrecompile [ -f ~/.zshrc ] && zrecompile -p ~/.zshrc [ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump [ -f ~/.zshrc.zwc.old ] && rm -f ~/.zshrc.zwc.old [ -f ~/.zcompdump.zwc.old ] && rm -f ~/.zcompdump.zwc.old source ~/.zshrc }