среда, 25 марта 2009 г.

My .zshrc

####################
# My Options
####################

zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list '' '' '' 'r:|[._-]=** r:|=**'
zstyle ':completion:*' menu yes select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle :compinstall filename '/home/hj/.zshrc'

host=(changeme1 ya.ru yandex.ru www.opennet.ru)
zstyle '*' hosts $hosts

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games:~/bin:~/bin/scripts
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'

autoload colors && colors
autoload -U zcalc
autoload -U compinit
compinit
autoload promptinit
promptinit
prompt elite2

HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000

# Get keys working
if [[ $TERM = "linux" ]];then
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
elif [[ $TERM = "xterm" || $TERM = "rxvt" ]];then
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[8~" end-of-line
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
fi

# My Options:

bindkey -v
eval `dircolors`

# mp3 tags 2 UTF-8 encoding:
mp32utf() { find -iname '*.mp3' -print0 | xargs -0 mid3iconv -eCP1251 --remove-v1 }

calc() {echo "${1}"|bc -l;}

export EDITOR vim

setopt APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt NO_BEEP
setopt AUTO_CD
setopt CORRECT_ALL
setopt SH_WORD_SPLIT
setopt histexpiredupsfirst histfindnodups
setopt IGNORE_EOF

setopt autocd
setopt extended_glob
setopt correct

case $TERN in
xterm*|rxvt)
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
preexec () { print -Pn "\e]0;%n@%m: $1\a" }
;;
screen)
precmd () { print -Pn "\033k%~\033\\" }
preexec () { print -Pn "\033k$1\033\\" }
;;
esac

#if [ -d ~/bin ] ; then
# PATH=~/bin:${PATH}"
#fi

# Aliases:
alias bmp="ping -c4 changeme"
alias cl="clear"
alias cp="nocorrect cp -iR"
alias df="df -h"
alias du="du -h"
alias duck="du -cksh *|sort -rn | head -10"
alias v="vim"
alias g="grep --color=auto"
alias gcpc='g++ -Wall -g -o'
alias h='history'
alias hlt='sudo shutdown -h now'
#alias ls="ls --color=auto"
alias l="ls -l --color=auto"
alias la="ls -al --color=auto"
alias lf="ls -alF --color=auto"
alias mc="mc -a"
alias mkd="nocorrect mkdir"
alias mlp="ping -c4 changeme"
alias mv="nocorrect mv -i"
alias rbt='sudo shutdown -r now'
alias rm="nocorrect rm -i"
alias rmf="nocorrect rm -f"
alias rmr="nocorrect -rm -Rf"
alias p="less"
alias user='ssh user@changeme'
alias ping='ping -c4'
alias psg="ps aux | grep"
alias re="reset"
alias sdr="screen -aAdr"
alias stp="ping -c4 changeme"

[[ -f /usr/bin/grc ]] && {
alias ping="grc --colour=auto ping -c4"
alias traceroute="grc --colour=auto traceroute"
alias make="grc --colour=auto make"
alias diff="grc --colour=auto diff"
alias cvs="grc --colour=auto cvs"
alias netstat="grc --colour=auto netstat"
}

#program starting:
alias -s {avi,mpeg,mpg,mov,m2v,flv}=mplayer
alias -s {fb2}=fbless
alias -s txt=$PAGER
alias -s py=python
alias -s {ogg,mp3,wav,wma}=mplayer
alias -s {png,gif,jpg,jpeg}=feh
alias -s {pdf,djvu}=evince

[[ -z $DISPLAY ]] && {
alias -s {odt,doc,sxw,xls,doc,rtf}=catdoc
alias -s {png,gif,jpg,jpeg}="fbi -a"
alias -s {pdf,djvu}=evince
}

fortune

# fortune | zenity --text-info

# Global aliases:
alias -g H="| head"
alias -g T="| tail"
alias -g G="| grep"
alias -g L="| less"
alias -g M="| most"
alias -g B="&|"
alias -g HL="--help"
alias -g LL="2>&1 | less"
alias -g CA="2>&1 | cat -A"
alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
# EOF

Комментариев нет: