From: martin f. krafft Date: Wed, 14 May 2008 21:11:03 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.madduck.net/~/git/pub/etc/zsh X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/ad251c8c9dbdc49a9118417654251ef18039125e?hp=4b52e0710a30230fb3a18ffd8567030faee8d256 Merge branch 'master' of ssh://git.madduck.net/~/git/pub/etc/zsh --- diff --git a/.zsh/rcsstub b/.zsh/rcsstub index 0f30dc6..b7736de 100644 --- a/.zsh/rcsstub +++ b/.zsh/rcsstub @@ -8,15 +8,21 @@ # Source repository: http://git.madduck.net/v/etc/zsh.git # -. $ZDOTDIR/logging -. $ZDOTDIR/util - if [[ -o rcs ]]; then + source $ZDOTDIR/logging + source $ZDOTDIR/util + source $ZDOTDIR/sourcedir + # __do_debug && set -x || : - file="%1N"; file="${(%)file}" - . $ZDOTDIR/sourcedir - sourcedir $ZDOTDIR/${file#.} + _DIR=$ZDOTDIR/${${(%):-%1N}#.} + sourcedir $_DIR + + if [[ -d $_DIR/parts.d ]]; then + sourcedir $_DIR/parts.d + fi + + unset _DIR # __do_debug && set +x || : fi diff --git a/.zsh/sourcedir b/.zsh/sourcedir index 4ce51a8..bb90720 100644 --- a/.zsh/sourcedir +++ b/.zsh/sourcedir @@ -12,6 +12,7 @@ sourcedir() { if [ ! -d "$1" ]; then + error "no such directory: $1" return 1 fi # debug "sourcing directory ${1#$ZDOTDIR/}" @@ -20,7 +21,7 @@ sourcedir() { *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;; esac # debug " sourcing file $f" - . "$f" + source "$f" done } diff --git a/.zsh/zlogin/.gitignore b/.zsh/zlogin/.gitignore new file mode 100644 index 0000000..53363b0 --- /dev/null +++ b/.zsh/zlogin/.gitignore @@ -0,0 +1 @@ +/parts.d diff --git a/.zsh/zlogout/.gitignore b/.zsh/zlogout/.gitignore new file mode 100644 index 0000000..53363b0 --- /dev/null +++ b/.zsh/zlogout/.gitignore @@ -0,0 +1 @@ +/parts.d diff --git a/.zsh/zprofile/.gitignore b/.zsh/zprofile/.gitignore new file mode 100644 index 0000000..53363b0 --- /dev/null +++ b/.zsh/zprofile/.gitignore @@ -0,0 +1 @@ +/parts.d diff --git a/.zsh/zprofile/40_zcompile b/.zsh/zprofile/40_zcompile index 174a757..925c3de 100644 --- a/.zsh/zprofile/40_zcompile +++ b/.zsh/zprofile/40_zcompile @@ -10,13 +10,22 @@ if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then rm -f $ZDOTDIR/**/*.zwc{,.old}(D.N) - for f ($ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.)) \ - [[ $f:t != .gitignore ]] && zcompile $f + for f in $ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.); do + case "$f:t" in + .gitignore|.*.sw?) continue;; + esac + zcompile $f + done fi if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then rm -f $ZVARDIR/**/*.zwc{,.old}(.N) - for f ($ZVARDIR/comp*(.N)) zcompile $f + for f in $ZVARDIR/comp*(.N); do + case "$f:t" in + .gitignore|.*.sw?) continue;; + esac + zcompile $f + done fi # vim:ft=zsh diff --git a/.zsh/zshenv/.gitignore b/.zsh/zshenv/.gitignore new file mode 100644 index 0000000..53363b0 --- /dev/null +++ b/.zsh/zshenv/.gitignore @@ -0,0 +1 @@ +/parts.d diff --git a/.zsh/zshrc/.gitignore b/.zsh/zshrc/.gitignore new file mode 100644 index 0000000..53363b0 --- /dev/null +++ b/.zsh/zshrc/.gitignore @@ -0,0 +1 @@ +/parts.d diff --git a/.zsh/zshrc/00_recompile b/.zsh/zshrc/00_recompile index fabb2e5..b721072 100644 --- a/.zsh/zshrc/00_recompile +++ b/.zsh/zshrc/00_recompile @@ -8,7 +8,7 @@ # Source repository: http://git.madduck.net/v/etc/zsh.git # -zrecompile $ZDOTDIR/**(N) $ZVARDIR/**(N) | while read pre file post; do +zrecompile $ZDOTDIR/**/*(/N) $ZVARDIR/**/*(/N) | while read pre file post; do case "$post" in succeeded*) rm -f "${file%:}".old;; *) :;; diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys index 9e5301c..3ccf1d4 100644 --- a/.zsh/zshrc/20_compsys +++ b/.zsh/zshrc/20_compsys @@ -47,11 +47,6 @@ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*:(all-|)files' ignored-patterns \ '*.bk' '*.bak' '*.old' '*~' '.*.sw?' -# populate hosts completion with SSH's known_hosts -local _myhosts -_myhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*}) -zstyle ':completion:*' hosts $_myhosts - zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) numeric )' #zstyle ':completion:*' list-suffixes true diff --git a/.zsh/zshrc/30_aliases b/.zsh/zshrc/30_aliases index 6cb0f9d..9df703a 100644 --- a/.zsh/zshrc/30_aliases +++ b/.zsh/zshrc/30_aliases @@ -93,11 +93,6 @@ alias h2d='baseconv 16 10' alias d2o='baseconv 10 8' alias o2d='baseconv 8 10' -alias sshnew='ssh -o "StrictHostKeyChecking no"' -alias scpnew='scp -o "StrictHostKeyChecking no"' -alias sshtmp='sshnew -o "UserKnownHostsFile /dev/null"' -alias scptmp='scpnew -o "UserKnownHostsFile /dev/null"' - alias sendmail=/usr/sbin/sendmail _d() { dict $* } diff --git a/.zsh/zshrc/60_vcsprompt b/.zsh/zshrc/60_vcsprompt index f9c440b..4cc18a3 100644 --- a/.zsh/zshrc/60_vcsprompt +++ b/.zsh/zshrc/60_vcsprompt @@ -70,6 +70,7 @@ __vcs_get_repo_type() local dir while true; do [ -d ${dir}.git ] && echo git && break + [ -d "$GIT_DIR" ] && echo git && break [ -d ${dir}.bzr ] && echo bzr && break [ -d ${dir}.hg ] && echo hg && break [ "$(readlink -f ${dir:-.})" = / ] && echo NONE && break @@ -140,7 +141,13 @@ __vcs_set_prompt_variables() branch="$(__git_get_branch)" || { error "could not determine git branch"; return 1 } eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch") - [ -d "$GIT_DIR" ] && set -- "$GIT_DIR" "$2" "$1" + if [ -d "$GIT_DIR" ]; then + # poor man's replace until I find out how to do named dirs properly + # here: + _D="${GIT_DIR/$HOME/~}" + set -- "$_D" "$2" "${${1#$_D}%/}" + unset _D + fi ;; hg) reporoot="$(__hg_get_reporoot)" || diff --git a/.zsh/zshrc/90_cleanfiles b/.zsh/zshrc/90_cleanfiles index b558145..555461c 100644 --- a/.zsh/zshrc/90_cleanfiles +++ b/.zsh/zshrc/90_cleanfiles @@ -10,23 +10,20 @@ typeset -la rmfiles -_OLDPWD="$PWD" -builtin cd ~ - -rmfiles+=plugin131.trace -rmfiles+=minicom.log -rmfiles+=.cshrc -rmfiles+=java.log.*(N) -rmfiles+=unison.log -rmfiles+=.bzr.log -rmfiles+=.fonts.cache-1 -rmfiles+=.gksu.lock -rmfiles+=.*.sw[mnop](N) -rmfiles+=.viminfo -rmfiles+=.bash_history -rmfiles+=core -rmfiles+=nohup.out -rmfiles+=typescript +rmfiles+=~/plugin131.trace +rmfiles+=~/minicom.log +rmfiles+=~/.cshrc +rmfiles+=~/java.log.*(N) +rmfiles+=~/unison.log +rmfiles+=~/.bzr.log +rmfiles+=~/.fonts.cache-1 +rmfiles+=~/.gksu.lock +rmfiles+=~/.*.sw[mnop](N) +rmfiles+=~/.viminfo +rmfiles+=~/.bash_history +rmfiles+=~/core +rmfiles+=~/nohup.out +rmfiles+=~/typescript typeset -la _rmfiles @@ -38,13 +35,10 @@ done unset rmfiles if [[ -n $_rmfiles ]]; then - info "Removing files: ${_rmfiles[@]}..." + info "Removing files: ${(j: :)${_rmfiles#$HOME/}}..." rm -f ${_rmfiles[@]} fi unset _rmfiles -builtin cd $_OLDPWD -unset _OLDPWD - # vim:ft=zsh