# .zshrc # Last Modified: Fri 01 Oct 2004 08:19:12 AM MDT # WTF fix this export PATH=$PATH:/home/daf/scripts:/usr/local/bin/ # -----/ Some colors /----- export red=$'%{\e[0;31m%}' export RED=$'%{\e[1;31m%}' export green=$'%{\e[0;32m%}' export GREEN=$'%{\e[1;32m%}' export blue=$'%{\e[0;34m%}' export BLUE=$'%{\e[1;34m%}' export purple=$'%{\e[0;35m%}' export PURPLE=$'%{\e[1;35m}' export cyan=$'%{\e[0;36m%}' export CYAN=$'%{\e[1;36m}' export WHITE=$'%{\e[1;37m}' export white=$'%{\e[0;37m}' export NC=$'%{\e[0m%}' export yellow=$'%{\e[0;33m%}' # -----/ default pager /----- export PAGER="less" # autoloads autoload -U compinit compinit autoload -U colors colors ## color completion zmodload -i zsh/complist # per host color choice case `hostname` in neptune*) PROMPTCOLOR=${blue} ;; sigma*) PROMPTCOLOR=${green} ;; swampdonkey*) PROMPTCOLOR=${purple} ;; esac # -----/ default prompt /----- PROMPT='${BLUE}%~ ${PROMPTCOLOR}->${NC} ' # -----/ right prompt /----- RPROMPT='${NC}[${PROMPTCOLOR}%m${NC}${BLACK}${NC}]' # -----/ aliases /----- alias ls='ls -Fa --color' alias torrant='btdownloadcurses.py --max_upload_rate 5' alias ll='ls -laFh --color' # --------------------- # history settings HISTFILE=~/.zshhistory HISTSIZE=3000 SAVEHIST=3000 # Other misc settings LISTMAX=0 # Make home, insert, delete and end work on PCs basically # like in doskey. This may or may not work for you... the # \e is the ESC character. To set this up for your favourite # system, type cat > rubbish, press the keys of interest, # then enter here what you see. You should replace ^[ # (escape) with \e. case $TERM in *xterm*|urxvt|(u|dt|k|E)term) bindkey '\eOH' beginning-of-line bindkey '\e[3~' delete-char bindkey '\eOF' end-of-line bindkey '\177' backward-delete-char bindkey '\e[2~' overwrite-mode # pgup/pgdown bindkey '\e[5~' up-line-or-search bindkey '\e[6~' down-line-or-search # ctrl left/right bindkey '\e[5D' backward-word bindkey '\e[5C' forward-word ;; esac # --------/ Completion stuff /-------- # ls settings (this is used for completion stuff) #eval `dircolors ~/.dir_colors` export LS_COLORS='no=00:fi=00:di=1;34:ln=04;35:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=04;37:*.tgz=04;37:*.arj=04;37:*.taz=04;37:*.lzh=04;37:*.zip=04;37:*.z=04;37:*.Z=04;37:*.gz=04;37:*.bz2=04;37:*.deb=04;37:*.rpm=04;37:*.css=01;33:*.html=01;33:*.htm=01;33:*.php=01;33:*.c=01;33:*.cc=01;33:*.cpp=01;33:*.pl=01;33:*.h=01;33:*.java=01;33:*.txt=01;37:*.jpg=36:*.gif=36:*.bmp=36:*.ppm=36:*.tga=36:*.xbm=36:*.xpm=36:*.tif=36:*.png=36:*.fli=36:*.gl=36:*.dl=36:*.mpg=01;35:*.mpeg=01;35:*.wmv=01;35:*.mov=01;35:*.avi=01;35:'; # TODO: temp, cuz can't figure out how to not cd to users zstyle ':completion:*:expand:*' accept-exact continue zstyle ':completion:*:cd:*' tag-order local-directories zstyle ':completion:*:scp:*' group-order \ users files all-files hosts-domain hosts-host hosts-ipaddr zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \ '*.*' loopback localhost zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \ '<->.<->.<->.<->' '^*.*' '*@*' zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \ '^<->.<->.<->.<->' '127.0.0.<->' zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \ adm bin daemon halt lp named shutdown sync zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=( ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ } )' # Expansion options zstyle ':completion:*' completer _complete _prefix zstyle ':completion::prefix-1:*' completer _complete zstyle ':completion:incremental:*' completer _complete _correct zstyle ':completion:predict:*' completer _complete # Completion caching zstyle ':completion::complete:*' use-cache 1 zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST # Expand partial paths zstyle ':completion:*' expand 'yes' zstyle ':completion:*' squeeze-slashes 'yes' # Include non-hidden directories in globbed file completions # for certain commands zstyle ':completion::complete:*' '\' # tag-order 'globbed-files directories' all-files zstyle ':completion::complete:*:tar:directories' file-patterns '*~.*(-/)' # Don't complete backup files as executables zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' # Separate matches into groups zstyle ':completion:*:matches' group 'yes' # Describe each match group. zstyle ':completion:*:descriptions' format "%B---- %d%b" # Messages/warnings format zstyle ':completion:*:messages' format '%B%U---- %d%u%b' zstyle ':completion:*:warnings' format '%B%U---- no match for: %d%u%b' # Describe options in full zstyle ':completion:*:options' description 'yes' zstyle ':completion:*:options' auto-description '%d' # }}} # {{{ Simulate my old dabbrev-expand 3.0.5 patch zstyle ':completion:*:history-words' stop verbose zstyle ':completion:*:history-words' remove-all-dups yes zstyle ':completion:*:history-words' list false zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} compctl -g "*.tar *.tgz *.tz *.tar.Z *.tar.bz2 *.tZ *.tar.gz" \ + -g "*(-/) .*(-/)" tar compctl -H 0 '' -k hosts telnet ftp ssh host nslookup rup rusers compctl -g "*(-/) .*(-/)" cd rmdir ## display fancy terminal title case $TERM in *xterm*|rxvt|(u|dt|k|E)term) ## display user@host and full dir in *term title precmd () { print -Pn "\033]0;%m: %~\007" #print -Pn "\033]0;%n@%m%# %~ %l %w :: %T\a" ## or use this } ## display user@host and name of current process in *term title preexec () { print -Pn "\033]0;%m ($1)\007" #print -Pn "\033]0;%n@%m%# <$1> %~ %l %w :: %T\a" ## or use this } ;; esac # zsh Options setopt \ NO_all_export \ always_last_prompt \ always_to_end \ append_history \ NO_auto_cd \ auto_list \ auto_menu \ NO_auto_name_dirs \ auto_param_keys \ auto_param_slash \ auto_pushd \ auto_remove_slash \ NO_auto_resume \ bad_pattern \ bang_hist \ NO_beep \ brace_ccl \ correct_all \ NO_bsd_echo \ cdable_vars \ NO_chase_links \ NO_clobber \ complete_aliases \ complete_in_word \ correct \ NO_correct_all \ csh_junkie_history \ NO_csh_junkie_loops \ NO_csh_junkie_quotes \ NO_csh_null_glob \ equals \ extended_glob \ extended_history \ function_argzero \ glob \ NO_glob_assign \ glob_complete \ NO_glob_dots \ glob_subst \ hash_cmds \ hash_dirs \ hash_list_all \ hist_allow_clobber \ hist_beep \ hist_ignore_dups \ hist_ignore_space \ NO_hist_no_store \ hist_verify \ NO_hup \ NO_ignore_braces \ NO_ignore_eof \ interactive_comments \ inc_append_history \ NO_list_ambiguous \ NO_list_beep \ list_types \ long_list_jobs \ magic_equal_subst \ NO_mail_warning \ NO_mark_dirs \ NO_menu_complete \ multios \ nomatch \ notify \ NO_null_glob \ numeric_glob_sort \ NO_overstrike \ path_dirs \ posix_builtins \ NO_print_exit_value \ NO_prompt_cr \ prompt_subst \ pushd_ignore_dups \ NO_pushd_minus \ pushd_silent \ pushd_to_home \ rc_expand_param \ NO_rc_quotes \ NO_rm_star_silent \ NO_sh_file_expansion \ sh_option_letters \ short_loops \ NO_sh_word_split \ NO_single_line_zle \ NO_sun_keyboard_hack \ unset \ NO_verbose \ zle