From bd785a01cf52b10622289bfa0a368535104f7c50 Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Sun, 13 Sep 2009 13:21:09 +0200 Subject: [PATCH 1/1] Initial checkin of zsh config --- .zsh.d/S01_completion | 55 +++++++++++++++++++++++++++++++++++++++++++ .zsh.d/S02_history | 28 ++++++++++++++++++++++ .zsh.d/S03_prompt | 24 +++++++++++++++++++ .zsh.d/S04_options | 39 ++++++++++++++++++++++++++++++ .zsh.d/S05_aliases | 22 +++++++++++++++++ .zsh.d/S06_exports | 14 +++++++++++ .zshrc | 26 ++++++++++++++++++++ 7 files changed, 208 insertions(+) create mode 100644 .zsh.d/S01_completion create mode 100644 .zsh.d/S02_history create mode 100644 .zsh.d/S03_prompt create mode 100644 .zsh.d/S04_options create mode 100644 .zsh.d/S05_aliases create mode 100644 .zsh.d/S06_exports create mode 100644 .zshrc diff --git a/.zsh.d/S01_completion b/.zsh.d/S01_completion new file mode 100644 index 0000000..8435ee9 --- /dev/null +++ b/.zsh.d/S01_completion @@ -0,0 +1,55 @@ +# http://xana.scru.org/2005/08/20#ignorelatexjunk +zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \ + 'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] && + reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()' + +# http://madism.org/~madcoder/dotfiles/zsh/40_completion +zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"' +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)[ 0-9:]#([^ ]#)*=01;30=01;31=01;38' + +zstyle ':completion:*:*:*:*' menu select + +# ignore working and backup copies, and compiled objects +zstyle ':completion:*:(all-|)files' ignored-patterns \ + '*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc' + +# functions which start with _ are internal and ignored +zstyle ':completion:*:functions' ignored-patterns '_*' + +# do not offer files already specified on the line +zstyle ':completion:*:rm:*' ignore-line yes + +zstyle ':completion:*' verbose yes +zstyle ':completion:*:descriptions' format '%B%d%b' +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:warnings' format 'no matches for: %d' +zstyle ':completion:*' group-name '' + +# commands that take commands as arguments +compdef _precommand gdb +compdef _precommand nohup +compdef _precommand strace + +# be magic about adding/removing final characters on tab completion +setopt auto_param_keys auto_param_slash auto_remove_slash + +# automatically list choices on an ambiguous completion +setopt auto_list + +# use menu after the second completion request +setopt auto_menu + +# recognise exact matches even if they're ambiguous +setopt rec_exact + +# move cursor to end of word being completed +setopt always_to_end + +# correct the command if mistyped +setopt correct + +# xmms2 needs a bit of manual help. +_xmms2_radd() { _files } + + +#vim: ft=zsh diff --git a/.zsh.d/S02_history b/.zsh.d/S02_history new file mode 100644 index 0000000..e61d17a --- /dev/null +++ b/.zsh.d/S02_history @@ -0,0 +1,28 @@ +# history expansion on pressing space +bindkey ' ' magic-space + +# treat ! specially like csh did +setopt bang_hist + +# ignore duplicates in the history +setopt hist_ignore_dups + +# save timestamp and duration with each event +setopt extended_history + +# properly lock the file on write, if that option exists +setopt hist_fcntl_lock 2>/dev/null + +# skip over non-contiguous duplicates when searching history +setopt hist_find_no_dups + +# don't store commands starting with a space in the history file +setopt hist_ignore_space + +# don't store history/fc -l invocations +setopt hist_no_store + +# remove superfluous blanks from each command line +setopt hist_reduce_blanks + +#vim: ft=zsh diff --git a/.zsh.d/S03_prompt b/.zsh.d/S03_prompt new file mode 100644 index 0000000..cf3abe3 --- /dev/null +++ b/.zsh.d/S03_prompt @@ -0,0 +1,24 @@ + +autoload -Uz vcs_info + +zstyle ':vcs_info:*' disable bzr cdv darcs mtn tla hg p4 svk +zstyle ':vcs_info:*' enable cvs svn git + +zstyle ':vcs_info:*' check-for-changes false +zstyle ':vcs_info:*' formats "[%s/%b-%c%u]" +zstyle ':vcs_info:*' actionformats "[%s/%b|%a-%c%u]" +zstyle ':vcs_info:*' stagedstr "!" +zstyle ':vcs_info:*' unstagedstr "?" + +precmd() { + psvar=() + + vcs_info + [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_" +} + +PS1="%m:%(1v.%F{red}%1v%f:.)%~%# " + +: ${RPS1:="#%(0?..%?,)%!"} + +# vim:ft=zsh diff --git a/.zsh.d/S04_options b/.zsh.d/S04_options new file mode 100644 index 0000000..491332e --- /dev/null +++ b/.zsh.d/S04_options @@ -0,0 +1,39 @@ +# automatically escape URLs +# /usr/share/zsh*/functions/Zle/url-quote-magic +autoload -U url-quote-magic +zle -N self-insert url-quote-magic +setopt no_nomatch + +# http://www.zsh.org/mla/users/2006/msg00399.html +autoload edit-command-line +zle -N edit-command-line +bindkey '\ee' edit-command-line + +# do not clobber files with > +setopt noclobber + +# automatically maintain a directory stack +setopt autopushd pushdminus pushdsilent pushdtohome + +# brace expansion +setopt braceccl + +# do not auto-nice background processes +setopt no_bgnice +# do not send HUP signal to jobs when the shell exits +setopt nohup +# do alert me of running jobs before exiting +setopt checkjobs +# use full globbing powers +setopt extended_glob + +# don't bitch about bad patterns, just use them verbatim +setopt no_bad_pattern + +# don't bitch about no matches, just the glob character verbatim +setopt no_nomatch + +# do. not. ever. beep. +setopt no_beep + +#vim:ft=zsh diff --git a/.zsh.d/S05_aliases b/.zsh.d/S05_aliases new file mode 100644 index 0000000..59167ae --- /dev/null +++ b/.zsh.d/S05_aliases @@ -0,0 +1,22 @@ +# I still use this for conflict resolution +alias emnw='emacs -nw' + +# Cil aliases +alias cam='cil am /dev/stdin yes' +alias ca='cil add --mine' +alias cl='cil summary --is-open --mine' + +# overwrite cal +alias cal='cal -m -3' + +# useful for git show branch:file | phpview +alias phpview="view -c 'set filetype=php' -" + +# make xev actually show useful output +alias xev="xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'" + +# switch between uk and us keyboards +alias uk='setxkbmap gb' +alias us='setxkbmap us' + +# vim:ft=zsh diff --git a/.zsh.d/S06_exports b/.zsh.d/S06_exports new file mode 100644 index 0000000..72c8b91 --- /dev/null +++ b/.zsh.d/S06_exports @@ -0,0 +1,14 @@ +export PATH=$PATH:/home/penny/bin/:/home/penny/src/android/tools +export DEBFULLNAME='Penny Leach' +export DEBEMAIL=penny@mjollnir.org +export GIT_AUTHOR_NAME='Penny Leach' +export GIT_AUTHOR_EMAIL=penny@mjollnir.org +export GIT_COMMITTER_NAME='Penny Leach' +export GIT_COMMITTER_EMAIL=penny@mjollnir.org +export TZ=Europe/Zurich +export MAIL=~/Maildir/sgn/INBOX +export MAILPATH=$MAIL +export COLORFGBG="default;default" + + +# vim:ft=zsh diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..4ff379d --- /dev/null +++ b/.zshrc @@ -0,0 +1,26 @@ +# The following lines were added by compinstall + +zstyle ':completion:*' completer _expand _complete _ignored +zstyle ':completion:*' max-errors 2 +zstyle ':completion:*' prompt 'Corrections: %e error(s)' +zstyle ':compinstall' filename "$HOME/.zshrc" + +autoload -Uz compinit +compinit +# End of lines added by compinstall +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt appendhistory extendedglob nomatch notify +bindkey -e + +# End of lines configured by zsh-newuser-install + + +# Penny - split things into smaller config files and then source them in order. +for zshrc_snipplet in ~/.zsh.d/S[0-9][0-9]*[^~] ; do + source $zshrc_snipplet +done + + -- 2.39.5