自拍微电影《牺牲》:zshrc配置(转载自别人)

来源:百度文库 编辑:九乡新闻网 时间:2024/10/05 22:45:15
#######################################################################           jdong's zshrc file v0.2.1 , based on:#      mako's zshrc file, v0.1## ######################################################################
# next lets set some enviromental/shell pref stuff up# setopt NOHUP#setopt NOTIFY#setopt NO_FLOW_CONTROLsetopt INC_APPEND_HISTORY SHARE_HISTORYsetopt APPEND_HISTORY# setopt AUTO_LIST # these two should be turned off# setopt AUTO_REMOVE_SLASH# setopt AUTO_RESUME # tries to resume command of same nameunsetopt BG_NICE # do NOT nice bg commandssetopt CORRECT # command CORRECTIONsetopt EXTENDED_HISTORY # puts timestamps in the history# setopt HASH_CMDS # turns on hashing#setopt MENUCOMPLETEsetopt ALL_EXPORT
# Set/unset  shell optionssetopt   notify globdots correct pushdtohome cdablevars autolistsetopt   correctall autocd recexact longlistjobssetopt   autoresume histignoredups pushdsilent setopt   autopushd pushdminus extendedglob rcquotes mailwarningunsetopt bgnice autoparamslash
# Autoload zsh modules when they are referencedzmodload -a zsh/stat statzmodload -a zsh/zpty zptyzmodload -a zsh/zprof zprofzmodload -ap zsh/mapfile mapfile

PATH="/usr/local/bin:/usr/local/sbin/:/bin:/sbin:/usr/bin:/usr/sbin:$PATH"HISTFILE=$HOME/.zhistoryHISTSIZE=1000SAVEHIST=1000HOSTNAME="`hostname`"PAGER='less'EDITOR='vim'    autoload colors zsh/terminfo    if [[ "$terminfo[colors]" -ge 8 ]]; then   colors    fi    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do   eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'   eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'   (( count = $count + 1 ))    done    PR_NO_COLOR="%{$terminfo[sgr0]%}"PS1="[$PR_BLUE%n$PR_WHITE@$PR_GREEN%U%m%u$PR_NO_COLOR:$PR_RED%2c$PR_NO_COLOR]%(!.#.$) "RPS1="$PR_LIGHT_YELLOW(%D{%m-%d %H:%M})$PR_NO_COLOR"
if [ $SSH_TTY ]; then  MUTT_EDITOR=vimelse  MUTT_EDITOR=emacsclient.emacs-snapshotfi
unsetopt ALL_EXPORT# # --------------------------------------------------------------------# # aliases# # --------------------------------------------------------------------
alias slrn="slrn -n"alias man='LC_ALL=C LANG=C man'alias f=fingeralias ll='ls -al'alias ls='ls --color=auto 'alias offlineimap-tty='offlineimap -u TTY.TTYUI'alias hnb-partecs='hnb $HOME/partecs/partecs-hnb.xml'alias rest2html-css='rst2html --embed-stylesheet --stylesheet-path=/usr/share/python-docutils/s5_html/themes/default/print.css'#if [[ $HOSTNAME == "kamna" ]] {# alias emacs='emacs -l ~/.emacs.kamna'#}
# alias =clear
#chpwd() {#     [[ -t 1 ]] || return#     case $TERM in#     sun-cmd) print -Pn "\e]l%~\e\\"#     ;;#    *xterm*|screen|rxvt|(dt|k|E)term) print -Pn "\e]2;%~\a"#    ;;#    esac#}selfupdate(){        URL="http://stuff.mit.edu/~jdong/misc/zshrc"        echo "Updating zshrc from $URL..."        echo "Press Ctrl+C within 5 seconds to abort..."        sleep 5        cp ~/.zshrc ~/.zshrc.old        wget $URL -O ~/.zshrc        echo "Done; existing .zshrc saved as .zshrc.old"}#chpwd
autoload -U compinitcompinitbindkey "^?" backward-delete-charbindkey '^[OH' beginning-of-linebindkey '^[OF' end-of-linebindkey '^[[5~' up-line-or-historybindkey '^[[6~' down-line-or-historybindkey "^r" history-incremental-search-backwardbindkey ' ' magic-space    # also do history expansion on spacebindkey '^I' complete-word # complete on tab, leave expansion to _expandzstyle ':completion::complete:*' use-cache onzstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'zstyle ':completion:*' menu select=1 _complete _ignored _approximatezstyle -e ':completion:*:approximate:*' max-errors \    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
# Completion Styles
# list of completers to usezstyle ':completion:*::::' completer _expand _complete _ignored _approximate
# allow one error for every three characters typed in approximate completerzstyle -e ':completion:*:approximate:*' max-errors \    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'    # insert all expansions for expand completerzstyle ':completion:*:expand:*' tag-order all-expansions
# formatting and messageszstyle ':completion:*' verbose yeszstyle ':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:*' group-name ''
# match uppercase from lowercasezstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# offer indexes before parameters in subscriptszstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
# command for process lists, the local web server details and host completion# on processes completion complete all user processes# zstyle ':completion:*:processes' command 'ps -au$USER'
## add colors to processes for kill completionzstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
#zstyle ':completion:*:processes' command 'ps ax -o pid,s,nice,stime,args | sed "/ps/d"'zstyle ':completion:*:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd'zstyle ':completion:*:processes-names' command 'ps axho command' #zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html'##NEW completion:# 1. All /etc/hosts hostnames are in autocomplete# 2. If you have a comment in /etc/hosts like #%foobar.domain,#    then foobar.domain will show up in autocomplete!zstyle ':completion:*' hosts $(awk '/^[^#]/ {print $2 $3" "$4" "$5}' /etc/hosts | grep -v ip6- && grep "^#%" /etc/hosts | awk -F% '{print $2}') # Filename suffixes to ignore during completion (except after rm command)zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \    '*?.old' '*?.pro'# the same for old style completion#fignore=(.o .c~ .old .pro)
# ignore completion functions (until the _ignored completer)zstyle ':completion:*:functions' ignored-patterns '_*'zstyle ':completion:*:*:*:users' ignored-patterns \        adm apache bin daemon games gdm halt ident junkbust lp mail mailnull \        named news nfsnobody nobody nscd ntp operator pcap postgres radvd \        rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs avahi-autoipd\        avahi backup messagebus beagleindex debian-tor dhcp dnsmasq fetchmail\        firebird gnats haldaemon hplip irc klog list man cupsys postfix\        proxy syslog www-data mldonkey sys snort# SSH Completionzstyle ':completion:*:scp:*' tag-order \   files users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'zstyle ':completion:*:scp:*' group-order \   files all-files users hosts-domain hosts-host hosts-ipaddrzstyle ':completion:*:ssh:*' tag-order \   users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *'zstyle ':completion:*:ssh:*' group-order \   hosts-domain hosts-host users hosts-ipaddrzstyle '*' single-ignored show