Permalink
Browse files

plugin to oad any bash completions in system

  • Loading branch information...
1 parent 1118059 commit fce1aa0d397d65b3b2dbaadc740565a307a9a305 @rsanders committed Feb 11, 2012
Showing with 24 additions and 0 deletions.
  1. +6 −0 zsh/plugins/bash-completions/functions/have
  2. +18 −0 zsh/plugins/bash-completions/zshrc.zsh
@@ -0,0 +1,6 @@
+#!/bin/zsh
+
+function have () {
+ [[ $+commands[$1] -eq 1 ]] && return 0
+ return 1
+}
@@ -0,0 +1,18 @@
+# initialize bash completion and load files from bashy dirs
+
+function () {
+ if ! bashcompinit >/dev/null 2>&1; then
+ autoload -U bashcompinit
+ bashcompinit -i
+ fi
+
+ local bashfile
+ typeset -a BASH_COMPLETION_DIRS
+ BASH_COMPLETION_DIRS+=( /etc/bash_completion.d /usr/local/etc/bash_completion.d )
+
+ path~glob_in_dirs '*' $bashcompdirs
+
+ for bashfile in $reply; do
+ source $bashfile 2>/dev/null
+ done
+}

0 comments on commit fce1aa0

Please sign in to comment.