#### /root/.zshrc ##### The following lines were added by compinstallautoload -Uz compinitcompinit# End of lines added by compinstall## aliases ##alias pager=/root/bin/vimpager # enable color support of ls and also add handy aliasesif [ "$TERM" != "dumb" ]; then eval "`dircolors -b`" alias ls='ls --color=auto' alias dir='ls --color=auto --format=vertical' alias vdir='ls --color=auto --format=long'fi## completion ### case-insensitive -> partial-word (cs) -> substring completion:# http://zsh.dotsrc.org/Guide/zshguide06.htmlzstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'# http://zsh.dotsrc.org/Guide/zshguide06.html#l149zmodload -i zsh/complistzstyle ':completion:*' menu select=1zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}bindkey -M menuselect '^@' accept-and-infer-next-history# tab completion for pidzstyle ':completion:*:*:kill:*' menu yes selectzstyle ':completion:*:kill:*' force-list always## exports ### set EDITORexport EDITOR=/usr/bin/vim# set MANPAGER#export MANPAGER=/bin/lessexport MANPAGER=/root/bin/vimpager# set PAGER#export PAGER=/bin/lessexport PAGER=/root/bin/vimpager# set/append to PATHexport PATH=$PATH:/root/bin## history ### The file to save the history in when an interactive shell exits. If unset, the history is not saved.HISTFILE=/root/.zhistory# The maximum number of events stored in the internal history list. If you use the HIST_EXPIRE_DUPS_FIRST option, setting this value# larger than the SAVEHIST size will give you the difference as a cushion for saving duplicated history events. HISTSIZE=1000# The maximum number of history events to save in the history file.SAVEHIST=1000# Save each commandâs beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. The # format of this prefixed data is: â:<beginning time>:<elapsed seconds>:<command>â.setopt EXTENDED_HISTORY# If a new command line being added to the history list duplicates an older one, the older command is removed from the list # (even if it is not the previous event).setopt HIST_IGNORE_ALL_DUPS# Remove command lines from the history list when the first character on the line is a space, or when one of the expanded aliases # contains a leading space. Note that the command lingers in the internal history until the next command is entered before it vanishes,# allowing you to briefly reuse or edit the line. If you want to make it vanish right away without entering another command, type a # space and press return.setopt HIST_IGNORE_SPACE# Remove superfluous blanks from each command line being added to the history list.setopt HIST_REDUCE_BLANKS# When writing out the history file, older commands that duplicate newer ones are omitted.setopt HIST_SAVE_NO_DUPS# let the user edit the command line after history expansion (e.g. !ls) instead of immediately running it setopt HIST_VERIFY# This options works like APPEND_HISTORY except that new history lines are added to the $HISTFILE incrementally (as soon# as they are entered), rather than waiting until the shell exits.setopt INC_APPEND_HISTORY# This option both imports new commands from the history file, and also causes your typed commands to be appended to the# history file (the latter is like specifying INC_APPEND_HISTORY).setopt SHARE_HISTORY## prompt ### info for using vi mode instead of emacs came from: # http://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/# but used the updated prompt; modified for my use, from: # http://pthree.org/wp-content/uploads/2009/10/zsh-prompt.txt### If I am using vi keys, I want to know what mode I'm currently using.# zle-keymap-select is executed every time KEYMAP changes.# From http://zshwiki.org/home/examples/zlewidgetszle-keymap-select() { VIMODE="${${KEYMAP/vicmd/ vi:command}/(main|viins)}" RPROMPT2="${PR_BOLD_WHITE}${VIMODE}" zle reset-prompt}zle -N zle-keymap-selectsetprompt () { # Need this, so the prompt will work setopt prompt_subst # let's load colors into our environment, then set them autoload colors if [[ "$terminfo[colors]" -gt 8 ]]; then colors fi # The variables are wrapped in %{%}. This should be the case for every # variable that does not contain space. for COLOR in BLACK BLUE CYAN GREEN RED WHITE YELLOW; do eval PR_$COLOR='%{$fg_no_bold[${(L)COLOR}]%}' eval PR_BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}' done eval PR_BOLD_DEFAULT='%{$fg_bold[default]%}' # Finally, let's set the prompt PROMPT='${PR_BOLD_WHITE}<${PR_WHITE}<${PR_BOLD_BLACK}<\${PR_BOLD_RED} %n@%m${PR_WHITE}${PR_BOLD_RED}%(?.. exit:%?)\${PR_BOLD_WHITE}${VIMODE}${PR_WHITE}|${PR_BOLD_WHITE}${PR_PWDCOLOR}%${PR_PWDLEN}<...<%~%<<\${PR_BOLD_BLACK}>${PR_RED}>${PR_BOLD_RED}>\%{${reset_color}%} '}setprompt## misc ### Selects keymap `viins'[vi emulation - insert mode] and also links it to `main'.; vi mode in zsh is not vim!, it is traditional vi.bindkey -v # Filename globbling, treat the #, ~ and ^ characters as part of patterns for filename generation, etc...setopt EXTENDED_GLOB # If a pattern for filename generation has no matches, print an error, instead of leaving it unchanged in the argument list.setopt NOMATCH# Automatically go to a directory, eg type % /etc and hit enter, zsh will chage to /etc.setopt AUTO_CD# no beepingsetopt NO_BEEP# spelling correctionsetopt CORRECT# Resolve symbolic links to their true values when changing directory. setopt CHASE_LINKS## this is commented out because it's setup in /root/.zlogin, left here as to maybe to run it from here instead ### share a single ssh-agent process between logins, shells, cron jobs, etc... using keychain#eval `keychain --eval --nogui -Q -q /root/.ssh/id_rsa`