summaryrefslogtreecommitdiff
path: root/plugins/brew/brew.plugin.zsh
diff options
context:
space:
mode:
authorAndrew Hodges <betawaffle@gmail.com>2011-05-28 10:57:48 -0400
committerAndrew Hodges <betawaffle@gmail.com>2011-05-28 10:57:48 -0400
commite263f1f0057f6cac15ef588c681e6f49713c3975 (patch)
tree6b6bd8bbafd0778426ab10c1f8edbbefd5eeeb9c /plugins/brew/brew.plugin.zsh
parent572b27b75724d00fbc99ef64de3dbd21a28c8194 (diff)
downloadzsh-e263f1f0057f6cac15ef588c681e6f49713c3975.tar.gz
zsh-e263f1f0057f6cac15ef588c681e6f49713c3975.tar.bz2
zsh-e263f1f0057f6cac15ef588c681e6f49713c3975.zip
Brew Plugin
Merge completion with official brew completion. Add a helper to link official completion into oh-my-zsh plugin (without overwriting). Add an alias to list installed brews. Add brews to the path (in a somewhat strange way).
Diffstat (limited to 'plugins/brew/brew.plugin.zsh')
-rw-r--r--plugins/brew/brew.plugin.zsh13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
new file mode 100644
index 000000000..f584a4684
--- /dev/null
+++ b/plugins/brew/brew.plugin.zsh
@@ -0,0 +1,13 @@
+# Move /usr/local/bin (path where brews are linked) to the front of the path
+# This will allow us to override system binaries like ruby with our brews
+# TODO: Do this in a more compatible way.
+# What if someone doesn't have /usr/bin in their path?
+export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
+export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'` # Add it in front of /usr/bin
+export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'` # Add /usr/local/sbin
+
+alias brews='brew list -1'
+
+function brew-link-completion {
+ ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
+}