summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/completion.zsh2
-rw-r--r--lib/termsupport.zsh14
-rw-r--r--oh-my-zsh.sh7
-rw-r--r--plugins/ant/ant.plugin.zsh6
-rw-r--r--plugins/cake/cake.plugin.zsh2
-rw-r--r--plugins/django/django.plugin.zsh1
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh4
-rw-r--r--plugins/wp-cli/wp-cli.plugin.zsh26
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh2
-rwxr-xr-xtools/install.sh2
10 files changed, 40 insertions, 26 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh
index 3a19a4eba..ea6139fde 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -38,7 +38,7 @@ cdpath=(.)
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
-zstyle ':completion::complete:*' cache-path $ZSH/cache/
+zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 9d6681603..bd0cf6ffe 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -1,7 +1,6 @@
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
#Fully support screen, iterm, and probably most modern xterm and rxvt
-#Limited support for Apple Terminal (Terminal can't set window or tab separately)
function title {
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
return
@@ -10,19 +9,26 @@ function title {
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" #set window name
- print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
+ print -Pn "\e]1;$1:q\a" #set icon (=tab) name
fi
}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
-#Appears when you have the prompt
+# Runs before showing the prompt
function omz_termsupport_precmd {
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
+
+ # Notify Terminal.app of current directory using undocumented OSC sequence
+ # found in OS X 10.9 and 10.10's /etc/bashrc
+ if [[ $TERM_PROGRAM == Apple_Terminal ]] && [[ -z $INSIDE_EMACS ]]; then
+ local PWD_URL="file://$HOSTNAME${PWD// /%20}"
+ printf '\e]7;%s\a' "$PWD_URL"
+ fi
}
-#Appears at the beginning of (and during) of command execution
+# Runs before executing the command
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index d75b521c7..bc7a8e496 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -14,6 +14,13 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
+# Set ZSH_CACHE_DIR to the path where cache files sould be created
+# or else we will use the default cache/
+if [[ -z "$ZSH_CACHE_DIR" ]]; then
+ ZSH_CACHE_DIR="$ZSH/cache/"
+fi
+
+
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
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/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/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/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index bc36c80db..e472578b0 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
+local cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed.
function chpwd() {
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"
diff --git a/tools/install.sh b/tools/install.sh
index a53ac48ab..69213d4a3 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -10,7 +10,7 @@ if [ -d "$ZSH" ]; then
fi
echo "\033[0;34mCloning Oh My Zsh...\033[0m"
-hash git >/dev/null 2>&1 && env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
+hash git >/dev/null 2>&1 && env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
echo "git not installed"
exit
}