]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'master' of ssh://git.madduck.net/~/git/pub/etc/zsh
authormartin f. krafft <madduck@madduck.net>
Wed, 14 May 2008 21:11:03 +0000 (23:11 +0200)
committermartin f. krafft <madduck@madduck.net>
Wed, 14 May 2008 21:11:03 +0000 (23:11 +0200)
13 files changed:
.zsh/rcsstub
.zsh/sourcedir
.zsh/zlogin/.gitignore [new file with mode: 0644]
.zsh/zlogout/.gitignore [new file with mode: 0644]
.zsh/zprofile/.gitignore [new file with mode: 0644]
.zsh/zprofile/40_zcompile
.zsh/zshenv/.gitignore [new file with mode: 0644]
.zsh/zshrc/.gitignore [new file with mode: 0644]
.zsh/zshrc/00_recompile
.zsh/zshrc/20_compsys
.zsh/zshrc/30_aliases
.zsh/zshrc/60_vcsprompt
.zsh/zshrc/90_cleanfiles

index 0f30dc62c94003ec223ea95f27ac709d5fdb6753..b7736deb022695d50efac8a7af5eb5d04a5859ff 100644 (file)
@@ -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
index 4ce51a8330985e0c93f766b9007539c9e58eae5f..bb90720a8de9e696fd21cad06bf8152b29abc7d3 100644 (file)
@@ -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 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zlogout/.gitignore b/.zsh/zlogout/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zprofile/.gitignore b/.zsh/zprofile/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
index 174a757d8c024b31ad1c7402554f1a6aad36ec29..925c3de06cdf8752d3857e5abd1d966a4c8e679d 100644 (file)
 
 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 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zshrc/.gitignore b/.zsh/zshrc/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
index fabb2e5094f925850c24235b9ebff22703cb6dac..b72107233d58ab4a385e83041a4c394241d7decc 100644 (file)
@@ -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;;
       *) :;;
index 9e5301cc5cd3d264d50d08c6a847fb863653f393..3ccf1d467f41a2042afd7fe85c72abfd6d8a46f9 100644 (file)
@@ -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
index 6cb0f9df77dac892222d4fabcfbc54fe094129ee..9df703a248bf7c8ae8a2f92addca62f8e24f1797 100644 (file)
@@ -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 $* }
index f9c440b7db0ad5a73e4fc64258e3c52fca61b48a..4cc18a3fd6feb72d174044579ad73d6999c7ccf7 100644 (file)
@@ -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)" ||
index b558145174d2f6196da1231a05c1b97ac74c5bcb..555461cddecb506d4b187abe3cd572ed8e1e6267 100644 (file)
 
 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