summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ant/ant.plugin.zsh6
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh11
-rw-r--r--plugins/cake/cake.plugin.zsh2
-rw-r--r--plugins/common-aliases/common-aliases.plugin.zsh6
-rw-r--r--plugins/dircycle/dircycle.plugin.zsh41
-rw-r--r--plugins/django/django.plugin.zsh1
-rw-r--r--plugins/git-prompt/git-prompt.plugin.zsh3
-rw-r--r--plugins/jump/jump.plugin.zsh1
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh4
-rw-r--r--plugins/sudo/sudo.plugin.zsh5
-rw-r--r--plugins/vi-mode/vi-mode.plugin.zsh8
-rw-r--r--plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh2
-rw-r--r--plugins/wp-cli/wp-cli.plugin.zsh26
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh2
14 files changed, 77 insertions, 41 deletions
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
index 45f2b06eb..0b738c94f 100644
--- a/plugins/ant/ant.plugin.zsh
+++ b/plugins/ant/ant.plugin.zsh
@@ -1,15 +1,15 @@
_ant_does_target_list_need_generating () {
[ ! -f .ant_targets ] && return 0;
- [ .ant_targets -nt build.xml ] && return 0;
+ [ build.xml -nt .ant_targets ] && return 0;
return 1;
}
_ant () {
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
- sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
fi
- compadd `cat .ant_targets`
+ compadd -- `cat .ant_targets`
fi
}
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index ca5666979..a8271849e 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,6 +1,17 @@
+# Activates autoenv or reports its failure
+if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
+ echo '-------- AUTOENV ---------'
+ echo 'Could not find ~/.autoenv/activate.sh.'
+ echo 'Please check if autoenv is correctly installed.'
+ echo 'In the meantime the autoenv plugin is DISABLED.'
+ echo '--------------------------'
+ return 1
+fi
+
# The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one.
+
use_env() {
typeset venv
venv="$1"
diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
index 44cc47470..2370df949 100644
--- a/plugins/cake/cake.plugin.zsh
+++ b/plugins/cake/cake.plugin.zsh
@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
fi
[ ! -f ${_cake_task_cache_file} ] && return 0;
- [ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
+ [ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
return 1;
}
diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh
index 90d59910c..e3830adcf 100644
--- a/plugins/common-aliases/common-aliases.plugin.zsh
+++ b/plugins/common-aliases/common-aliases.plugin.zsh
@@ -20,12 +20,6 @@ alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f'
-# because typing 'cd' is A LOT of work!!
-alias ..='cd ../'
-alias ...='cd ../../'
-alias ....='cd ../../../'
-alias .....='cd ../../../../'
-
# Command line head / tail shortcuts
alias -g H='| head'
alias -g T='| tail'
diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
index c6b6ba785..1e31105b1 100644
--- a/plugins/dircycle/dircycle.plugin.zsh
+++ b/plugins/dircycle/dircycle.plugin.zsh
@@ -1,10 +1,37 @@
-##
-# dircycle plugin: enables cycling through the directory
-# stack using Ctrl+Shift+Left/Right
+# enables cycling through the directory stack using
+# Ctrl+Shift+Left/Right
+#
+# left/right direction follows the order in which directories
+# were visited, like left/right arrows do in a browser
-eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
+# NO_PUSHD_MINUS syntax:
+# pushd +N: start counting from left of `dirs' output
+# pushd -N: start counting from right of `dirs' output
+
+insert-cycledleft () {
+ emulate -L zsh
+ setopt nopushdminus
+
+ builtin pushd -q +1 &>/dev/null || true
+ zle reset-prompt
+}
zle -N insert-cycledleft
-bindkey "\e[1;6D" insert-cycledleft
-eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q +0'; zle accept-line }"
+
+insert-cycledright () {
+ emulate -L zsh
+ setopt nopushdminus
+
+ builtin pushd -q -0 &>/dev/null || true
+ zle reset-prompt
+}
zle -N insert-cycledright
-bindkey "\e[1;6C" insert-cycledright
+
+
+# add key bindings for iTerm2
+if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ bindkey "^[[1;6D" insert-cycledleft
+ bindkey "^[[1;6C" insert-cycledright
+else
+ bindkey "\e[1;6D" insert-cycledleft
+ bindkey "\e[1;6C" insert-cycledright
+fi \ No newline at end of file
diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
index aaaa7d21d..2e9ce1c52 100644
--- a/plugins/django/django.plugin.zsh
+++ b/plugins/django/django.plugin.zsh
@@ -236,5 +236,6 @@ _managepy() {
compdef _managepy manage.py
compdef _managepy django
+compdef _managepy django-admin
compdef _managepy django-admin.py
compdef _managepy django-manage
diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh
index 01b8a88d9..d868a5fe1 100644
--- a/plugins/git-prompt/git-prompt.plugin.zsh
+++ b/plugins/git-prompt/git-prompt.plugin.zsh
@@ -2,9 +2,6 @@
# http://github.com/olivierverdier/zsh-git-prompt
#
export __GIT_PROMPT_DIR=$ZSH/plugins/git-prompt
-# Initialize colors.
-autoload -U colors
-colors
# Allow for functions in the prompt.
setopt PROMPT_SUBST
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index b16814fe4..d082c11e5 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -27,7 +27,6 @@ unmark() {
rm -i "$MARKPATH/$1"
}
-autoload colors
marks() {
for link in $MARKPATH/*(@); do
local markname="$fg[cyan]${link:t}$reset_color"
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index bc36c80db..4fa6fcc34 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -4,8 +4,8 @@
# Flag indicating if we've previously jumped to last directory.
typeset -g ZSH_LAST_WORKING_DIRECTORY
-mkdir -p "$ZSH/cache"
-local cache_file="$ZSH/cache/last-working-dir"
+mkdir -p $ZSH_CACHE_DIR
+cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed.
function chpwd() {
diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
index d12e06853..e3ba39918 100644
--- a/plugins/sudo/sudo.plugin.zsh
+++ b/plugins/sudo/sudo.plugin.zsh
@@ -13,9 +13,8 @@
# ------------------------------------------------------------------------------
sudo-command-line() {
-[[ -z $BUFFER ]] && zle up-history
-[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER"
-zle end-of-line
+ [[ -z $BUFFER ]] && zle up-history
+ [[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
index 3ed32b3fb..f2745b409 100644
--- a/plugins/vi-mode/vi-mode.plugin.zsh
+++ b/plugins/vi-mode/vi-mode.plugin.zsh
@@ -14,6 +14,14 @@ function zle-keymap-select zle-line-init zle-line-finish {
zle -R
}
+# Ensure that the prompt is redrawn when the terminal size changes.
+TRAPWINCH() {
+ if [[ -o zle ]]; then
+ zle reset-prompt
+ zle -R
+ fi
+}
+
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index 52e02d3e0..217ab0722 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -38,7 +38,7 @@ if (( $+commands[$virtualenvwrapper] )); then
source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
fi
fi
- elif [ $CD_VIRTUAL_ENV ]; then
+ elif [[ -n $CD_VIRTUAL_ENV && -n $VIRTUAL_ENV ]]; then
# We've just left the repo, deactivate the environment
# Note: this only happens if the virtualenv was activated automatically
deactivate && unset CD_VIRTUAL_ENV
diff --git a/plugins/wp-cli/wp-cli.plugin.zsh b/plugins/wp-cli/wp-cli.plugin.zsh
index 5d9551e24..ac430b7a2 100644
--- a/plugins/wp-cli/wp-cli.plugin.zsh
+++ b/plugins/wp-cli/wp-cli.plugin.zsh
@@ -52,19 +52,19 @@ alias wpmlo='wp menu location'
# Option
# Plugin
-alias wppa='activate'
-alias wppda='deactivate'
-alias wppd='delete'
-alias wppg='get'
-alias wppi='install'
-alias wppis='is-installed'
-alias wppl='list'
-alias wppp='path'
-alias wpps='search'
-alias wppst='status'
-alias wppt='toggle'
-alias wppu='uninstall'
-alias wppu='update'
+alias wppa='wp plugin activate'
+alias wppda='wp plugin deactivate'
+alias wppd='wp plugin delete'
+alias wppg='wp plugin get'
+alias wppi='wp plugin install'
+alias wppis='wp plugin is-installed'
+alias wppl='wp plugin list'
+alias wppp='wp plugin path'
+alias wpps='wp plugin search'
+alias wppst='wp plugin status'
+alias wppt='wp plugin toggle'
+alias wppu='wp plugin uninstall'
+alias wppu='wp plugin update'
# Post
alias wppoc='wp post create'
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index 3f44b99c6..cde9ebeca 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -1,7 +1,7 @@
# reload zshrc
function src()
{
- local cache="$ZSH/cache"
+ local cache=$ZSH_CACHE_DIR
autoload -U compinit zrecompile
compinit -d "$cache/zcomp-$HOST"