summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/diagnostics.zsh30
-rw-r--r--lib/misc.zsh28
-rw-r--r--plugins/gradle/gradle.plugin.zsh12
-rw-r--r--plugins/pyenv/pyenv.plugin.zsh6
-rw-r--r--plugins/rails/rails.plugin.zsh1
-rwxr-xr-xtools/install.sh7
6 files changed, 61 insertions, 23 deletions
diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh
index afc33829b..9c9905e4d 100644
--- a/lib/diagnostics.zsh
+++ b/lib/diagnostics.zsh
@@ -52,6 +52,9 @@
# * Consider whether to move default output file location to TMPDIR. More robust
# but less user friendly.
#
+
+autoload -Uz is-at-least
+
function omz_diagnostic_dump() {
emulate -L zsh
@@ -247,7 +250,7 @@ function _omz_diag_dump_one_big_text() {
function _omz_diag_dump_check_core_commands() {
builtin echo "Core command check:"
- local redefined name builtins externals
+ local redefined name builtins externals reserved_words
redefined=()
# All the zsh non-module builtin commands
# These are taken from the zsh reference manual for 5.0.2
@@ -255,17 +258,32 @@ function _omz_diag_dump_check_core_commands() {
# (For back-compatibility, if any of these are newish, they should be removed,
# or at least made conditional on the version of the current running zsh.)
# "history" is also excluded because OMZ is known to redefine that
+ reserved_words=( do done esac then elif else fi for case if while function
+ repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}'
+ )
builtins=( alias autoload bg bindkey break builtin bye cd chdir command
comparguments compcall compctl compdescribe compfiles compgroups compquote comptags
- comptry compvalues continue declare dirs disable disown echo echotc echoti emulate
- enable eval exec exit export false fc fg float functions getln getopts hash
- integer jobs kill let limit local log logout noglob popd print printf
- pushd pushln pwd r read readonly rehash return sched set setopt shift
- source suspend test times trap true ttyctl type typeset ulimit umask unalias
+ comptry compvalues continue dirs disable disown echo echotc echoti emulate
+ enable eval exec exit false fc fg functions getln getopts hash
+ jobs kill let limit log logout noglob popd print printf
+ pushd pushln pwd r read rehash return sched set setopt shift
+ source suspend test times trap true ttyctl type ulimit umask unalias
unfunction unhash unlimit unset unsetopt vared wait whence where which zcompile
zle zmodload zparseopts zregexparse zstyle )
+ if is-at-least 5.1; then
+ reserved_word+=( declare export integer float local readonly typeset )
+ else
+ builtins+=( declare export integer float local readonly typeset )
+ fi
builtins_fatal=( builtin command local )
externals=( zsh )
+ for name in $reserved_words; do
+ if [[ $(builtin whence -w $name) != "$name: reserved" ]]; then
+ builtin echo "reserved word '$name' has been redefined"
+ builtin which $name
+ redefined+=$name
+ fi
+ done
for name in $builtins; do
if [[ $(builtin whence -w $name) != "$name: builtin" ]]; then
builtin echo "builtin '$name' has been redefined"
diff --git a/lib/misc.zsh b/lib/misc.zsh
index 8ff076e77..c81dab413 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -1,14 +1,19 @@
## Load smart urls if available
-for d in $fpath; do
- if [[ -e "$d/url-quote-magic" ]]; then
- if [[ -e "$d/bracketed-paste-magic" ]]; then
- autoload -Uz bracketed-paste-magic
- zle -N bracketed-paste bracketed-paste-magic
- fi
- autoload -U url-quote-magic
- zle -N self-insert url-quote-magic
- fi
-done
+# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
+autoload -Uz is-at-least
+if [[ $ZSH_VERSION != 5.1.1 ]]; then
+ for d in $fpath; do
+ if [[ -e "$d/url-quote-magic" ]]; then
+ if is-at-least 5.1; then
+ autoload -Uz bracketed-paste-magic
+ zle -N bracketed-paste bracketed-paste-magic
+ fi
+ autoload -Uz url-quote-magic
+ zle -N self-insert url-quote-magic
+ break
+ fi
+ done
+fi
## jobs
setopt long_list_jobs
@@ -22,8 +27,7 @@ alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
-if which ack-grep &> /dev/null;
-then
+if which ack-grep &> /dev/null; then
alias afind='ack-grep -il'
else
alias afind='ack -il'
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index 97941756d..661c29d5b 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -1,6 +1,6 @@
#!zsh
##############################################################################
-# A descriptive listing of core Gradle commands
+# A descriptive listing of core Gradle commands
############################################################################
function _gradle_core_commands() {
local ret=1 state
@@ -32,14 +32,22 @@ function _gradle_arguments() {
'--stop[Stop the Gradle daemon]' \
'--daemon[Use the Gradle daemon]' \
'--no-daemon[Do not use the Gradle daemon]' \
- '--no-opt[Do not perform any task optimization]' \
+ '--rerun-task [Specifies that any task optimization is ignored.]' \
'-i[Log at the info level]' \
'-m[Dry run]' \
'-P[Set a project property]' \
+ '-p[Specifies the start directory]' \
'--profile[Profile the build time]' \
'-q[Log at the quiet level (only show errors)]' \
'-v[Print the Gradle version info]' \
'-x[Specify a task to be excluded]' \
+ '-b[Specifies the build file.]' \
+ '-c[Specifies the settings file.]' \
+ '--continue[Continues task execution after a task failure.]' \
+ '-g[Specifies the Gradle user home directory.]' \
+ '-I[Specifies an initialization script.]' \
+ '--refresh-dependencies[Refresh the state of dependencies.]' \
+ '-u[Don''t search in parent directories for a settings.gradle file.]' \
'*::command:->command' \
&& return 0
}
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index b3dc7aa17..aa1f9488a 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -17,7 +17,11 @@ for pyenvdir in "${pyenvdirs[@]}" ; do
FOUND_PYENV=1
export PYENV_ROOT=$pyenvdir
export PATH=${pyenvdir}/bin:$PATH
- eval "$(pyenv init --no-rehash - zsh)"
+ eval "$(pyenv init - zsh)"
+
+ if pyenv commands | command grep -q virtualenv-init; then
+ eval "$(pyenv virtualenv-init - zsh)"
+ fi
function pyenv_prompt_info() {
echo "$(pyenv version-name)"
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index 1bbd1fb4b..a390c919c 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -42,6 +42,7 @@ alias rp='rails plugin'
alias ru='rails runner'
alias rs='rails server'
alias rsd='rails server --debugger'
+alias rsp='rails server --port'
# Rake aliases
alias rdm='rake db:migrate'
diff --git a/tools/install.sh b/tools/install.sh
index 5633320a8..67d341c7c 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -1,5 +1,3 @@
-set -e
-
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
tput=$(which tput)
@@ -21,6 +19,11 @@ else
BOLD=""
NORMAL=""
fi
+
+# Only enable exit-on-error after the non-critical colorization stuff,
+# which may fail on systems lacking tput or terminfo
+set -e
+
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"