Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- umask 022
- zmodload zsh/complist
- ZLS_COLORS=$LS_COLORS
- HISTSIZE=1000
- SAVEHIST=1000
- HISTFILE=~/.history
- TMOUT=6500
- #regular prompt
- PS1='%B%m%b%# '
- #options
- #standard options:
- setopt \
- no_beep \
- auto_cd \
- complete_in_word \
- hash_cmds \
- list_types \
- auto_remove_slash \
- NO_menu_complete \
- NO_auto_menu \
- NO_hup \
- NO_list_beep \
- interactive_comments \
- inc_append_history \
- auto_list \
- chase_dots \
- extendedglob
- #aliases
- alias s='sudo -s'
- alias ss='./script/server --debugger'
- alias v='vim .'
- alias ls='ls -G'
- alias l='ls -G'
- alias ll='l -al'
- alias la='l -a'
- alias lp='l -la | less'
- alias md=mkdir
- # format titles for screen and rxvt
- function title() {
- # escape '%' chars in $1, make nonprintables visible
- a=${(V)1//\%/\%\%}
- # Truncate command, and join lines.
- a=$(print -Pn "%40>...>$a" | tr -d "\n")
- case $TERM in
- screen)
- print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
- ;;
- xterm*|rxvt)
- print -Pn "\e]2;$2 | $a:$3\a" # plain xterm title
- ;;
- esac
- }
- # precmd is called just before the prompt is printed
- function precmd() {
- title "zsh" "$USER@%m" "%55<...<%~"
- }
- # preexec is called just before any command line is executed
- function preexec() {
- title "$1" "$USER@%m" "%35<...<%~"
- }
- #don't keep core dumps
- ulimit -c 0
- #get completions
- if [ -s ".compctl" ];
- then source .compctl
- fi
- bindkey ${$(echotc bt 2>&-):-"^[[Z"} menu-select
- bindkey ${$(echotc bt 2>&-):-"[Z"} menu-select
- source ~/.prompt
- typeset PATH=~/bin:$PATH
- export PATH=/usr/local/mysql-5.1.37-osx10.5-x86_64/bin/:$PATH
- #expirmental stuff
- autoload -U compinit
- compinit -C
- ## completions ####
- ## General completion technique
- ## complete as much u can ..
- #zstyle ':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct _approximate _prefix
- ## complete less
- #zstyle ':completion:*' completer _expand _complete _list _ignored _approximate
- ## complete minimal
- #zstyle ':completion:*' completer _complete _ignored
- zstyle ':completion:*' completer _complete _ignored _approximate
- ## allow one error
- #zstyle ':completion:*:approximate:*' max-errors 1 numeric
- ## allow one error for every three characters typed in approximate completer
- zstyle -e ':completion:*:approximate:*' max-errors \
- 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
- ## formatting and messages
- zstyle ':completion:*' verbose yes
- zstyle ':completion:*:descriptions' format $'%{\e[1;30m%}%d%{\e[0m%}'
- zstyle ':completion:*:messages' format $'%{\e[1;30m%}%d%{\e[0m%}'
- zstyle ':completion:*:warnings' format $'%{\e[0;37m%}no matches for %{\e[1;30m%}[%{\e[0;37m%}%d%{\e[1;30m%}]%{\e[0m%}'
- zstyle ':completion:*:corrections' format $'%{\e[1;30m%}%d (errors: %e)%{\e[0m%}'
- zstyle ':completion:*' group-name ''
- ## determine in which order the names (files) should be
- ## listed and completed when using menu completion.
- ## `size' to sort them by the size of the file
- ## `links' to sort them by the number of links to the file
- ## `modification' or `time' or `date' to sort them by the last modification time
- ## `access' to sort them by the last access time
- ## `inode' or `change' to sort them by the last inode change time
- ## `reverse' to sort in decreasing order
- ## If the style is set to any other value, or is unset, files will be
- ## sorted alphabetically by name.
- zstyle ':completion:*' file-sort name
- ## how many completions switch on menu selection
- ## use 'long' to start menu compl. if list is bigger than screen
- ## or some number to start menu compl. if list has that number
- ## of completions (or more).
- zstyle ':completion:*' menu select=long
- ## case-insensitive (uppercase from lowercase) completion
- #zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
- ## case-insensitive (all) completion
- #zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
- ## case-insensitive,partial-word and then substring completion
- zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
- ## offer indexes before parameters in subscripts
- zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
- ## insert all expansions for expand completer
- zstyle ':completion:*:expand:*' tag-order all-expansions
- ## ignore completion functions (until the _ignored completer)
- zstyle ':completion:*:functions' ignored-patterns '_*'
- ## completion caching
- zstyle ':completion::complete:*' use-cache 1
- zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST
- ## add colors to completions
- zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
- ## don't complete backup files as executables
- zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
- ## filename suffixes to ignore during completion (except after rm command)
- zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \
- '*?.(o|c~|old|pro|zwc)' '*~'
- ## completions for some progs. not in default completion system
- zstyle ':completion:*:*:mpg123:*' file-patterns \
- '*.(mp3|MP3):mp3\ files *(-/):directories'
- #zstyle ':completion:*:*:ogg123:*' file-patterns \
- #'*.(ogg|OGG):ogg\ files *(-/):directories'
- ## generic completions for programs which understand GNU long options(--help)
- compdef _gnu_generic slrnpull make df du
- ## on processes completion complete all user processes
- zstyle ':completion:*:processes' command 'ps -au$USER'
- ## add colors to processes for kill completion
- zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
- zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
- zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
- #cdpath=(~ .. /www/ats)
- alias -g ...='../..'
- alias -g ....='../../..'
- alias -g .....='../../../..'
- alias -g W=' | wc -l '
- alias -g C=' | cut '
- alias -g S=' | sort '
- alias -g SN=' | sort -n '
- alias -g U=' | uniq '
- alias -g UC=' | uniq -c '
- alias -g V=' | vim -'
- alias -g G=' | grep '
- alias -g GL=' | grep -l '
- alias -g GI=' | grep -i '
- alias -g GIL=' | grep -il '
- alias -g GR=' | grep -r '
- alias -g GRL=' | grep -rl '
- alias -g GIR=' | grep -ir '
- alias -g GIRL=' | grep -irl '
- cgrep()
- {
- output=`command grep --color=always "$@" | sed 's/^\([^:]*\)/\\\033[92m\1\\\033[0m/g'`
- echo -e "$output"
- }
- bak()
- {
- TIMESTAMP=`date +%Y%m%d%H%M%S`
- cp "$1" "$1.$TIMESTAMP"
- }
- if [[ `whoami` = root ]]; then
- PS1="# "
- else
- PS1="$ "
- fi
Add Comment
Please, Sign In to add comment