Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################################################################
- # Zsh settings file for Greg Fitzgerald <netzdamon@gmail.com>
- #
- # Most recent update: Fri Sep 28 18:38:41 2007
- #
- ###############################################################################
- ##############################################################################
- # Clear screen on logout
- ##############################################################################
- trap clear 0
- ################################################################################
- # Enviroment Variables
- ################################################################################
- #export MAILCHECK=10
- export MAILDIR="${HOME}/mbox"
- export MAIL="${HOME}/mbox/inbox"
- export VISUAL="vim"
- export EDITOR="vim"
- export RSYNC_RSH="ssh"
- #export MANPAGER="col -b | view -c 'set ft=man nomod nolist' -"
- export MANPAGER="less"
- #export LANG=en_US.utf8
- #export LC_CTYPE=en_US.utf8
- #export TZ=EST5EDT
- export PAGER="less"
- export GIT_AUTHOR_EMAIL="claneys.skyne@gmail.com"
- export GIT_AUTHOR_NAME="Claneys Skyne"
- export GIT_COMMITTER_EMAIL="claneys.skyne@gmail.com"
- export MPD_HOST="192.168.1.20"
- export MPD_PORT="6601"
- export CVS_RSH='ssh'
- export RSYNC_RSH='ssh'
- ################################################################################
- # Resource Limits
- ################################################################################
- limit stack 8192
- #limit core 9999
- limit core 0
- limit -s
- ###############################################################################
- # Setup History Options
- ################################################################################
- HISTSIZE=5000
- HISTFILE=${HOME}/.history_zsh
- SAVEHIST=5000
- ################################################################################
- # Term Settings
- ################################################################################
- #auto logout after timeout in seconds
- TMOUT=1800
- # if we are in X then disable TMOUT
- case $TERM in
- *xterm*|rxvt|(dt|k|E)term)
- unset TMOUT
- ;;
- esac
- #case $TERM in
- # *xterm*|rxvt|(dt|k|E)term)
- # ## display user@host and full dir in *term title
- # precmd () {
- # print -Pn <span>"\033]0;%n@%m %~\007"
- # }
- # ## display user@host and name of current process in *term title
- # preexec () {
- # print -Pn "\033]0;%n@%m <$1> %~\007"
- # }
- # ;;
- #esac
- ################################################################################
- # Default Aliases
- ################################################################################
- alias xlog=" grep --binary-files=without-match --color -nsie '(EE)' -e '(WW)' /var/log/Xorg.0.log"
- alias which="whence"
- alias sd='export DISPLAY=:0.0'
- alias ctar="tar -cvpf"
- alias cpan="perl -MCPAN -e shell"
- alias cup='cvs -z3 update -Pd'
- alias mv='nocorrect /bin/mv'
- alias rm='nocorrect /bin/rm -i'
- alias cp='nocorrect /bin/cp'
- alias man='nocorrect man'
- alias mkdir='nocorrect /bin/mkdir -p'
- alias find='noglob find'
- alias wget="wget -c"
- alias ls="ls --color"
- alias lsd='ls -lh --color'
- #alias cgrep='grep --binary-files=without-match --color -nsi'
- alias mpalyer="mplayer"
- alias mplyaer="mplayer"
- alias ncmpc="ncmpc -c"
- alias fixdbus="dbus-uuidgen --ensure"
- alias fspot="dbus-launch f-spot"
- alias m="mplayer"
- alias e="vim"
- alias p="paludis"
- alias repo='cd /var/paludis/repositories'
- alias blog='cd /home/gregf/code/rails_apps/blog/'
- alias scm='cd /home/gregf/code/scm/'
- alias sc='script/console'
- alias ss='script/server'
- alias diff='colordiff'
- alias nv=' paludis -i nvidia-drivers'
- alias burniso='wodim -v dev=/dev/cdrw'
- alias usepretend='paludis -ip --dl-reinstall if-use-changed everything'
- alias usedo=' paludis -i --dl-reinstall if-use-changed everything'
- alias use=' -e /etc/paludis/use.conf'
- alias whats_installed="eix -I --nocolor -c > /tmp/installed.txt && less /tmp/installed.txt && rm /tmp/installed.txt"
- ################################################################################
- # Functions and Completion
- ################################################################################
- # Magically quote urls
- autoload -U url-quote-magic
- zle -N self-insert url-quote-magic
- #dload zsh/complist
- autoload -U compinit && compinit
- ### If you want zsh's completion to pick up new commands in $path automatically
- #### comment out the next line and un-comment the following 5 lines
- #zstyle ':completion:::::' completer _complete _approximate
- ##_force_rehash() {
- ## (( CURRENT == 1 )) && rehash
- ## return 1 # Because we didn't really complete anything
- ##}
- #zstyle ':completion:::::' completer _force_rehash _complete _approximate
- zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
- zstyle ':completion:*:descriptions' format "- %d -"
- zstyle ':completion:*:corrections' format "- %d - (errors %e})"
- zstyle ':completion:*:default' list-prompt '%S%M matches%s'
- zstyle ':completion:*' group-name ''
- zstyle ':completion:*:manuals' separate-sections true
- zstyle ':completion:*:manuals.(^1*)' insert-sections true
- zstyle ':completion:*' menu select
- zstyle ':completion:*' verbose yes
- ################################################################################
- # Custom Functions
- ################################################################################
- # keep these around to try with vde again later on
- #-net vde,vlan=0,sock=/var/run/vde.ctl \
- #-net nic,vlan=0,macaddr 52:54:00:00:AA:02 \
- function pskill {
- kill -9 `pgrep $1`
- echo "slaughtered."
- }
- function kscreen {
- echo -ne "\017"
- reset
- }
- function date {
- if [ $# = 0 ]; then
- # Format: Saturday, December 21, 2002 06:46:38 PM EST
- command date +"%A, %B %e %Y %I:%M:%S %p %Z"
- else
- # Execute real `date'
- command date $@
- fi
- }
- function mcdrom {
- local mounted
- local cpwd
- mounted=$(grep cdrom /etc/mtab)
- if [[ $mounted = "" ]];then
- mount /mnt/cdrom
- echo "-- mounted cdrom --"
- cd /media/amovible/cdrom ; ls
- else
- cpwd=$(pwd|grep cdrom)
- if [[ $cpwd = "" ]];then
- umount /mnt/cdrom
- echo "-- umounted cdrom --"
- else
- cd;umount /mnt/cdrom
- echo "-- umounted cdrom --"
- pwd
- fi
- fi
- }
- function decompress {
- if [[ -f "$1" ]]
- then
- case "$1" in
- (*.tar.bz2) tar -xvjf "$1" ;;
- (*.tar.gz) tar -xvzf "$1" ;;
- (*.ace) unace e "$1" ;;
- (*.rar) unrar e "$1" ;;
- (*.deb) ar -x "$1" ;;
- (*.bz2) bzip2 -d "$1" ;;
- (*.lzh) lha x "$1" ;;
- (*.gz) gunzip -d "$1" ;;
- (*.tar) tar -xvf "$1" ;;
- (*.tgz) gunzip -d "$1" ;;
- (*.tbz2) tar -jxvf "$1" ;;
- (*.zip) unzip "$1" ;;
- (*.Z) uncompress "$1" ;;
- (*.shar) sh "$1" ;;
- (*) echo "'"$1"' Error. Please go away" ;;
- esac
- else
- echo <span>"'<span>"$1"' is not a valid file<span>"
- fi
- }
- function ddcompress {
- for dir in `ls -1 --color=none --group-directories-first`
- do
- cd $dir
- decompress *.rar
- cd ..
- done
- }
- function mps { /bin/ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ; }
- function ech {
- CHPTH=`eix --only-names -e $1`
- less /usr/portage/$CHPTH/ChangeLog
- }
- ################################################################################
- # Get keys working
- ################################################################################
- #
- # For this to work you have to first run 'zsh /usr/share/zsh/4.1.0_pre7/functions/Misc/zkbd'.
- # The location of this script on your system may vary.
- # Also note you must change the 'source' line below to match your zkbd config.
- bindkey -v
- case `echo $TERM` in
- linux)
- source ~/.zkbd/linux-pc-linux-gnu
- ;;
- xterm-color)
- source ~/.zkbd/xterm-color-pc-linux-gnu
- ;;
- xterm)
- source ~/.zkbd/xterm-redhat-linux-gnu
- ;;
- esac
- [[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char
- [[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char
- [[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-history
- [[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-history
- [[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
- [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
- [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
- case $TERM in
- linux)
- source ~/.zkbd/linux-pc-linux-gnu
- bindkey "^[[2~" yank
- bindkey "^[[3~" delete-char
- bindkey "^[[5~" up-line-or-history ## PageUp
- bindkey "^[[6~" down-line-or-history ## PageDown
- bindkey "^[[4~" end-of-line
- bindkey "^[e" expand-cmd-path
- bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
- bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
- bindkey " " magic-space ## do history expansion on space
- bindkey "^[[1~" beginning-of-line
- ;;
- xterm|xterm-color)
- source ~/.zkbd/xterm-redhat-linux-gnu
- bindkey "^[[2~" yank
- bindkey "^[[3~" delete-char
- bindkey "^[[5~" up-line-or-history ## PageUp
- bindkey "^[[6~" down-line-or-history ## PageDown
- bindkey "^[[7~" beginning-of-line
- bindkey "^[[8~" end-of-line
- bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
- bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
- bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
- bindkey " " magic-space ## do history expansion on space
- ;;
- esac
- ###############################################################################
- # Autocomplete for current dir on filetypes
- ################################################################################
- # Set Prompt
- autoload -U promptinit
- # Follow GNU LS_COLORS
- promptinit
- prompt_adam2_setup
- zmodload -i zsh/complist
- eval $(dircolors -b /etc/DIR_COLORS)
- zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
- zstyle ':completion:*:*:kill:*' list-colors '=%*=01;31'
- autoload -U compinit
- compinit
- compctl -g '*.Z *.gz *.tgz' + -g '*' zcat gunzip open
- compctl -g '*.tar.Z *.tar.gz *.tgz *.tar.bz2' + -g '*' tar open
- compctl -g '*.zip *.ZIP' + -g '*' unzip zip open
- compctl -g '*.rar *.RAR' + -g '*' rar unrar open
- compctl -g '*.(mp3|MP3|ogg|OGG|WAV|wav)' + -g '*(-/)' ogg123 mpg123 audacious wma123 mplayer
- compctl -g '*.(divx|DIVX|m4v|M4V|wmv|WMV|avi|AVI|mpg|mpeg|MPG|MPEG|WMV|wmv|mov|MOV|wma|WMA|w4a|W4A)' + -g '*(-/)' xine mplayer kmplayer gmplayer vlc
- compctl -g '*.(pdf|PDF|ps|PS|tiff|TIFF)' + -g '*(-/)' evince acroread xpdf epdfview
- compctl -g '*.(jpg|JPG|jpeg|JPEG|gif|GIF|tiff|TIFF|png|PNG)' + -g '*(-/)' feh gthumb xv
- #compdef -a _portage emerge
- # Select Prompt
- zstyle ':completion:*' menu select=1
- # 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:*' '\'
- # Use menuselection for pid completion
- zstyle ':completion:*:*:kill:*' menu yes select
- zstyle ':completion:*:kill:*' force-list always
- zstyle ':completion:*:processes' command 'ps -au$USER'
- zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
- # 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'
- # With commands like rm, it's annoying if you keep getting offered the same
- # file multiple times. This fixes it. Also good for cp, et cetera..
- zstyle ':completion:*:rm:*' ignore-line yes
- zstyle ':completion:*:cp:*' ignore-line 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'
- # 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 '*\~'
- setopt \
- NO_all_export \
- always_last_prompt \
- always_to_end \
- share_history \
- append_history \
- auto_cd \
- auto_list \
- auto_menu \
- 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 \
- NO_correct_all \
- NO_bsd_echo \
- NO_cdable_vars \
- NO_chase_links \
- clobber \
- complete_aliases \
- complete_in_word \
- NO_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 \
- NO_hash_cmds \
- NO_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 \
- 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 \
- NO_equals
- ################################################################################
- # Set global unmask
- ################################################################################
- #umask 077 #Safe permissions
- #umask 022 #More usefull for me
- # Run devtodo if not root, to annoy me to do something.
- if [ -x /usr/bin/devtodo ]; then
- if [ "`id -u`" != "0" ]; then
- /usr/bin/devtodo
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement