From 9f4ceea4ab35a89aab3ce825f93d22b3447f5f6b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 31 Aug 2011 00:02:50 -0400 Subject: [PATCH] Added z plugin. --- plugins/z/z.plugin.zsh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plugins/z/z.plugin.zsh diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh new file mode 100644 index 00000000..a4211e3c --- /dev/null +++ b/plugins/z/z.plugin.zsh @@ -0,0 +1,28 @@ +# ------------------------------------------------------------------------------ +# FILE: z.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Sorin Ionescu +# VERSION: 1.0.0 +# ------------------------------------------------------------------------------ + + +# z is the new j. +# https://github.com/rupa/z + +if [[ -f /etc/profile.d/z.zsh ]]; then + source /etc/profile.d/z.zsh +elif [[ -f /opt/local/etc/profile.d/z.zsh ]]; then + source /opt/local/etc/profile.d/z.zsh +elif [[ -f "$(brew --prefix 2> /dev/null)/etc/profile.d/z.sh" ]]; then + source "$(brew --prefix 2> /dev/null)/etc/profile.d/z.sh" +fi + +if (( $+functions[_z] )); then + alias z='nocorrect _z 2>&1' + function z-precmd () { + z --add "$(pwd -P)" + } + autoload -Uz add-zsh-hook + add-zsh-hook precmd z-precmd +fi +