summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown2
-rw-r--r--lib/clipboard.zsh86
-rw-r--r--lib/diagnostics.zsh30
-rw-r--r--lib/misc.zsh31
-rw-r--r--oh-my-zsh.sh18
-rw-r--r--plugins/atom/README.md23
-rw-r--r--plugins/atom/atom.plugin.zsh37
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh28
-rw-r--r--plugins/coffee/coffee.plugin.zsh10
-rw-r--r--plugins/colored-man-pages/colored-man-pages.plugin.zsh (renamed from plugins/colored-man/colored-man.plugin.zsh)0
-rw-r--r--plugins/copydir/copydir.plugin.zsh6
-rw-r--r--plugins/copyfile/copyfile.plugin.zsh8
-rw-r--r--plugins/encode64/encode64.plugin.zsh4
-rw-r--r--plugins/git-extras/README.md11
-rw-r--r--plugins/git-extras/git-extras.plugin.zsh82
-rw-r--r--plugins/git-hubflow/git-hubflow.plugin.zsh7
-rw-r--r--plugins/git/git.plugin.zsh2
-rw-r--r--plugins/gradle/gradle.plugin.zsh12
-rw-r--r--plugins/gulp/gulp.plugin.zsh4
-rw-r--r--plugins/nmap/README.md19
-rw-r--r--plugins/nmap/nmap.plugin.zsh6
-rw-r--r--plugins/npm/npm.plugin.zsh4
-rw-r--r--plugins/pyenv/pyenv.plugin.zsh6
-rw-r--r--plugins/rails/rails.plugin.zsh3
-rw-r--r--plugins/sublime/sublime.plugin.zsh3
-rw-r--r--plugins/systemd/systemd.plugin.zsh4
-rw-r--r--plugins/textmate/textmate.plugin.zsh8
-rw-r--r--plugins/xcode/xcode.plugin.zsh5
-rw-r--r--tools/uninstall.sh7
29 files changed, 299 insertions, 167 deletions
diff --git a/README.markdown b/README.markdown
index a29df81ab..779ce77c3 100644
--- a/README.markdown
+++ b/README.markdown
@@ -5,7 +5,7 @@ Oh My Zsh is an open source, community-driven framework for managing your [zsh](
__Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interact with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
-To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
+To learn more, visit [ohmyz.sh](http://ohmyz.sh) and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
new file mode 100644
index 000000000..b663800a4
--- /dev/null
+++ b/lib/clipboard.zsh
@@ -0,0 +1,86 @@
+# System clipboard integration
+#
+# This file has support for doing system clipboard copy and paste operations
+# from the command line in a generic cross-platform fashion.
+#
+# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other
+# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the
+# "system clipboard", and the X Windows `xclip` command must be installed.
+
+# clipcopy - Copy data to clipboard
+#
+# Usage:
+#
+# <command> | clipcopy - copies stdin to clipboard
+#
+# clipcopy <file> - copies a file's contents to clipboard
+#
+function clipcopy() {
+ emulate -L zsh
+ local file=$1
+ if [[ $OSTYPE == darwin* ]]; then
+ if [[ -z $file ]]; then
+ pbcopy
+ else
+ cat $file | pbcopy
+ fi
+ elif [[ $OSTYPE == cygwin* ]]; then
+ if [[ -z $file ]]; then
+ cat > /dev/clipboard
+ else
+ cat $file > /dev/clipboard
+ fi
+ else
+ if which xclip &>/dev/null; then
+ if [[ -z $file ]]; then
+ xclip -in -selection clipboard
+ else
+ xclip -in -selection clipboard $file
+ fi
+ elif which xsel &>/dev/null; then
+ if [[ -z $file ]]; then
+ xsel --clipboard --input
+ else
+ cat "$file" | xsel --clipboard --input
+ fi
+ else
+ print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
+ return 1
+ fi
+ fi
+}
+
+# clippaste - "Paste" data from clipboard to stdout
+#
+# Usage:
+#
+# clippaste - writes clipboard's contents to stdout
+#
+# clippaste | <command> - pastes contents and pipes it to another process
+#
+# clippaste > <file> - paste contents to a file
+#
+# Examples:
+#
+# # Pipe to another process
+# clippaste | grep foo
+#
+# # Paste to a file
+# clippaste > file.txt
+function clippaste() {
+ emulate -L zsh
+ if [[ $OSTYPE == darwin* ]]; then
+ pbpaste
+ elif [[ $OSTYPE == cygwin* ]]; then
+ cat /dev/clipboard
+ else
+ if which xclip &>/dev/null; then
+ xclip -out -selection clipboard
+ elif which xsel &>/dev/null; then
+ xsel --clipboard --output
+ else
+ print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
+ return 1
+ fi
+ fi
+}
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 bdb884046..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,7 +27,11 @@ alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
-alias afind='ack-grep -il'
+if which ack-grep &> /dev/null; then
+ alias afind='ack-grep -il'
+else
+ alias afind='ack -il'
+fi
# only define LC_CTYPE if undefined
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 8e31ddd0f..6cc5ac630 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -11,6 +11,8 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
+: ${ZSH_DISABLE_COMPFIX:=true}
+
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
@@ -62,13 +64,17 @@ if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
-# If completion insecurities exist, warn the user without enabling completions.
-if ! compaudit &>/dev/null; then
- # This function resides in the "lib/compfix.zsh" script sourced above.
- handle_completion_insecurities
-# Else, enable and cache completions to the desired file.
+if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
+ # If completion insecurities exist, warn the user without enabling completions.
+ if ! compaudit &>/dev/null; then
+ # This function resides in the "lib/compfix.zsh" script sourced above.
+ handle_completion_insecurities
+ # Else, enable and cache completions to the desired file.
+ else
+ compinit -d "${ZSH_COMPDUMP}"
+ fi
else
- compinit -d "${ZSH_COMPDUMP}"
+ compinit -i -d "${ZSH_COMPDUMP}"
fi
# Load all of the plugins that were defined in ~/.zshrc
diff --git a/plugins/atom/README.md b/plugins/atom/README.md
deleted file mode 100644
index 6350c647b..000000000
--- a/plugins/atom/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-## atom
-
-This plugin makes "at" a useful function for invoking the Atom Editor.
-
-Originally by Github user [aforty](https://github.com/aforty) for OSX, modified to alias 'at' to 'atom' for Linux, since atom already works on the terminal for Linux, and calling 'at' in a non-OSX environment should still work.
-
-### Requirements
-
- * [Atom](https://atom.io/)
-
-### Usage
-
- * If `at` command is called without an argument, launch Atom
-
- * If `at` is passed a directory, open it in Atom
-
- * If `at` is passed a file, open it in Atom
-
-### Examples
-
- * Open the current dir in atom: `at .`
- * Open another dir in atom: `at path/to/folder`
- * Open a file: `at filename.extension`
diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh
deleted file mode 100644
index 2711cf0e8..000000000
--- a/plugins/atom/atom.plugin.zsh
+++ /dev/null
@@ -1,37 +0,0 @@
-case $OSTYPE in
-darwin*)
- local _atom_paths > /dev/null 2>&1
- _atom_paths=(
- "$HOME/Applications/Atom.app"
- "/Applications/Atom.app"
- )
-
- for _atom_path in $_atom_paths; do
- if [[ -a $_atom_path ]]; then
- alias at="open -a '$_atom_path'"
- break
- fi
- done
- ;;
-cygwin)
- local _atom_path > /dev/null 2>&1
-
- _atom_path=${LOCALAPPDATA}/atom/bin/atom
-
- if [[ -a $_atom_path ]]; then
- cyg_open_atom()
- {
- if [[ -n $1 ]]; then
- ${_atom_path} `cygpath -w -a $1`
- else
- ${_atom_path}
- fi
- }
-
- alias at=cyg_open_atom
- fi
- ;;
-linux*)
- # Alerts the user if 'atom' is not a found command.
- type atom >/dev/null 2>&1 && alias at="atom" || { echo >&2 "You have enabled the atom oh-my-zsh plugin on Linux, but atom is not a recognized command. Please make sure you have it installed before using this plugin."; }
-esac
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index a8271849e..ea2e56dd6 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,12 +1,26 @@
# 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
+() {
+if ! type autoenv_init >/dev/null; then
+ for d (~/.autoenv /usr/local/opt/autoenv); do
+ if [[ -e $d/activate.sh ]]; then
+ autoenv_dir=$d
+ break
+ fi
+ done
+ if [[ -z $autoenv_dir ]]; then
+ cat <<END >&2
+-------- AUTOENV ---------
+Could not locate autoenv installation.
+Please check if autoenv is correctly installed.
+In the meantime the autoenv plugin is DISABLED.
+--------------------------
+END
+ return 1
+ fi
+ source $autoenv_dir/activate.sh
fi
+}
+[[ $? != 0 ]] && return $?
# 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.
diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh
index 4e98e0228..77cb663f7 100644
--- a/plugins/coffee/coffee.plugin.zsh
+++ b/plugins/coffee/coffee.plugin.zsh
@@ -6,11 +6,11 @@ cf () {
}
# compile & copy to clipboard
cfc () {
- cf "$1" | pbcopy
+ cf "$1" | clipcopy
}
-# compile from pasteboard & print
-alias cfp='coffeeMe "$(pbpaste)"'
+# compile from clipboard & print
+alias cfp='coffeeMe "$(clippaste)"'
-# compile from pasteboard and copy to clipboard
-alias cfpc='cfp | pbcopy'
+# compile from clipboard and copy to clipboard
+alias cfpc='cfp | clipcopy'
diff --git a/plugins/colored-man/colored-man.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index 5c613f49d..5c613f49d 100644
--- a/plugins/colored-man/colored-man.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
diff --git a/plugins/copydir/copydir.plugin.zsh b/plugins/copydir/copydir.plugin.zsh
index 37bb5e086..c45106240 100644
--- a/plugins/copydir/copydir.plugin.zsh
+++ b/plugins/copydir/copydir.plugin.zsh
@@ -1,3 +1,5 @@
+# Copies the pathname of the current directory to the system or X Windows clipboard
function copydir {
- pwd | tr -d "\r\n" | pbcopy
-} \ No newline at end of file
+ emulate -L zsh
+ print -n $PWD | clipcopy
+}
diff --git a/plugins/copyfile/copyfile.plugin.zsh b/plugins/copyfile/copyfile.plugin.zsh
index 944a903c6..f4eca5acf 100644
--- a/plugins/copyfile/copyfile.plugin.zsh
+++ b/plugins/copyfile/copyfile.plugin.zsh
@@ -1,5 +1,7 @@
+# Copies the contents of a given file to the system or X Windows clipboard
+#
+# copyfile <file>
function copyfile {
- [[ "$#" != 1 ]] && return 1
- local file_to_copy=$1
- cat $file_to_copy | pbcopy
+ emulate -L zsh
+ clipcopy $1
}
diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh
index 4dbd1b453..53de6478a 100644
--- a/plugins/encode64/encode64.plugin.zsh
+++ b/plugins/encode64/encode64.plugin.zsh
@@ -1,4 +1,4 @@
-encode64(){ echo -n $1 | base64 }
-decode64(){ echo -n $1 | base64 --decode }
+encode64(){ printf '%s' $1 | base64 }
+decode64(){ printf '%s' $1 | base64 --decode }
alias e64=encode64
alias d64=decode64
diff --git a/plugins/git-extras/README.md b/plugins/git-extras/README.md
new file mode 100644
index 000000000..8f12e297e
--- /dev/null
+++ b/plugins/git-extras/README.md
@@ -0,0 +1,11 @@
+# git-extras
+
+This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras).
+
+## Setup notes
+
+The completions work by augmenting the `_git` completion provided by `zsh`. This only works with the `zsh`-provided `_git`, not the `_git` provided by `git` itself. If you have both `zsh` and `git` installed, you need to make sure that the `zsh`-provided `_git` takes precedence.
+
+### OS X Homebrew Setup
+
+On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands.
diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
index d91c1af81..681fbb466 100644
--- a/plugins/git-extras/git-extras.plugin.zsh
+++ b/plugins/git-extras/git-extras.plugin.zsh
@@ -1,10 +1,13 @@
-#compdef git
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for git-extras (http://github.com/tj/git-extras).
#
+# This depends on and reueses some of the internals of the _git completion
+# function that ships with zsh itself. It will not work with the _git that ships
+# with git.
+#
# ------------------------------------------------------------------------------
# Authors
# -------
@@ -22,16 +25,18 @@
# ------------------------------------------------------------------------------
-__git_command_successful () {
- if (( ${#pipestatus:#0} > 0 )); then
- _message 'not a git repository'
- return 1
- fi
- return 0
-}
+# Internal functions
+# These are a lot like their __git_* equivalents inside _git
+__gitex_command_successful () {
+ if (( ${#*:#0} > 0 )); then
+ _message 'not a git repository'
+ return 1
+ fi
+ return 0
+}
-__git_commits() {
+__gitex_commits() {
declare -A commits
git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
do
@@ -42,7 +47,7 @@ __git_commits() {
_describe -t commits commit commits && ret=0
}
-__git_tag_names() {
+__gitex_tag_names() {
local expl
declare -a tag_names
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
@@ -51,7 +56,7 @@ __git_tag_names() {
}
-__git_branch_names() {
+__gitex_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
@@ -59,7 +64,7 @@ __git_branch_names() {
_wanted branch-names expl branch-name compadd $* - $branch_names
}
-__git_specific_branch_names() {
+__gitex_specific_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
@@ -67,32 +72,28 @@ __git_specific_branch_names() {
_wanted branch-names expl branch-name compadd $* - $branch_names
}
-
-__git_feature_branch_names() {
- __git_specific_branch_names 'feature'
+__gitex_feature_branch_names() {
+ __gitex_specific_branch_names 'feature'
}
-
-__git_refactor_branch_names() {
- __git_specific_branch_names 'refactor'
+__gitex_refactor_branch_names() {
+ __gitex_specific_branch_names 'refactor'
}
-
-__git_bug_branch_names() {
- __git_specific_branch_names 'bug'
+__gitex_bug_branch_names() {
+ __gitex_specific_branch_names 'bug'
}
-
-__git_submodule_names() {
+__gitex_submodule_names() {
local expl
declare -a submodule_names
- submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
+ submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
__git_command_successful || return
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
}
-__git_author_names() {
+__gitex_author_names() {
local expl
declare -a author_names
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
@@ -123,7 +124,7 @@ _git-bug() {
case $line[1] in
(finish)
_arguments -C \
- ':branch-name:__git_bug_branch_names'
+ ':branch-name:__gitex_bug_branch_names'
;;
esac
esac
@@ -139,7 +140,7 @@ _git-changelog() {
_git-contrib() {
_arguments \
- ':author:__git_author_names'
+ ':author:__gitex_author_names'
}
@@ -151,19 +152,19 @@ _git-count() {
_git-delete-branch() {
_arguments \
- ':branch-name:__git_branch_names'
+ ':branch-name:__gitex_branch_names'
}
_git-delete-submodule() {
_arguments \
- ':submodule-name:__git_submodule_names'
+ ':submodule-name:__gitex_submodule_names'
}
_git-delete-tag() {
_arguments \
- ':tag-name:__git_tag_names'
+ ':tag-name:__gitex_tag_names'
}
@@ -172,6 +173,7 @@ _git-effort() {
'--above[ignore file with less than x commits]'
}
+
_git-extras() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
@@ -216,7 +218,7 @@ _git-feature() {
case $line[1] in
(finish)
_arguments -C \
- ':branch-name:__git_feature_branch_names'
+ ':branch-name:__gitex_feature_branch_names'
;;
esac
esac
@@ -225,8 +227,8 @@ _git-feature() {
_git-graft() {
_arguments \
- ':src-branch-name:__git_branch_names' \
- ':dest-branch-name:__git_branch_names'
+ ':src-branch-name:__gitex_branch_names' \
+ ':dest-branch-name:__gitex_branch_names'
}
@@ -236,12 +238,14 @@ _git-ignore() {
'(--global -g)'{--global,-g}'[show global gitignore]'
}
+
_git-missing() {
_arguments \
- ':first-branch-name:__git_branch_names' \
- ':second-branch-name:__git_branch_names'
+ ':first-branch-name:__gitex_branch_names' \
+ ':second-branch-name:__gitex_branch_names'
}
+
_git-refactor() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
@@ -263,7 +267,7 @@ _git-refactor() {
case $line[1] in
(finish)
_arguments -C \
- ':branch-name:__git_refactor_branch_names'
+ ':branch-name:__gitex_refactor_branch_names'
;;
esac
esac
@@ -272,12 +276,12 @@ _git-refactor() {
_git-squash() {
_arguments \
- ':branch-name:__git_branch_names'
+ ':branch-name:__gitex_branch_names'
}
_git-summary() {
- _arguments '--line[summarize with lines other than commits]'
- __git_commits
+ _arguments '--line[summarize with lines rather than commits]'
+ __gitex_commits
}
diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh
index 4cf5b9177..b0157c7a1 100644
--- a/plugins/git-hubflow/git-hubflow.plugin.zsh
+++ b/plugins/git-hubflow/git-hubflow.plugin.zsh
@@ -20,6 +20,13 @@
# c. Or, use this file as an oh-my-zsh plugin.
#
+alias ghf='git hf'
+alias ghff='git hf feature'
+alias ghfr='git hf release'
+alias ghfh='git hf hotfix'
+alias ghfs='git hf support'
+alias ghfu='git hf update'
+
_git-hf ()
{
local curcontext="$curcontext" state line
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 4f2745038..d78b82df3 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -212,11 +212,13 @@ alias gsts='git stash show --text'
alias gsu='git submodule update'
alias gts='git tag -s'
+alias gtv='git tag | sort -V'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
+alias glum='git pull upstream master'
alias gvt='git verify-tag'
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/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh
index 8e11a444f..f7eaefa85 100644
--- a/plugins/gulp/gulp.plugin.zsh
+++ b/plugins/gulp/gulp.plugin.zsh
@@ -19,8 +19,8 @@
# Grabs all available tasks from the `gulpfile.js`
# in the current directory.
#
-function $$gulp_completion() {
- compls=$(grep -Eo "gulp.task\((['\"](([a-zA-Z0-9]|-)*)['\"],)" gulpfile.js 2>/dev/null | grep -Eo "['\"](([a-zA-Z0-9]|-)*)['\"]" | sed s/"['\"]"//g | sort)"
+function $$gulp_completion {
+ compls="$(grep -Eo "gulp.task\((['\"](([a-zA-Z0-9]|-)*)['\"],)" gulpfile.js 2>/dev/null | grep -Eo "['\"](([a-zA-Z0-9]|-)*)['\"]" | sed s/"['\"]"//g | sort)"
completions=(${=compls})
compadd -- $completions
diff --git a/plugins/nmap/README.md b/plugins/nmap/README.md
index 8bb8e0648..5cd646277 100644
--- a/plugins/nmap/README.md
+++ b/plugins/nmap/README.md
@@ -19,14 +19,19 @@ Nmap options are:
## Aliases explained
- * nmap_open_ports - scan for open ports on target
- * nmap_list_interfaces - list all network interfaces on host where the command runs
- * nmap_slow - slow scan that avoids to spam the targets logs
- * nmap_fin - scan to see if hosts are up with TCP FIN scan
- * nmap_full - aggressive full scan that scans all ports, tries to determine OS and service versions
+ * nmap_open_ports - Scan for open ports on target
+ * nmap_list_interfaces - List all network interfaces on host where the command runs
+ * nmap_slow - Slow scan that avoids to spam the targets logs
+ * nmap_fin - Scan to see if hosts are up with TCP FIN scan
+ * nmap_full - Aggressive full scan that scans all ports, tries to determine OS and service versions
* nmap_check_for_firewall - TCP ACK scan to check for firewall existence
* nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
restrictions
* nmap_fast - Fast scan of the top 300 popular ports
- * nmap_detect_versions - detects versions of services and OS, runs on all ports
- * nmap_check_for_vulns - uses vulscan script to check target services for vulnerabilities
+ * nmap_detect_versions - Detects versions of services and OS, runs on all ports
+ * nmap_check_for_vulns - Uses vulscan script to check target services for vulnerabilities
+ * nmap_full_udp - Same as full but via UDP
+ * nmap_traceroute - Try to traceroute using the most common ports
+ * nmap_full_with_scripts - Same as nmap_full but also runs all the scripts
+ * nmap_web_safe_osscan - Little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking.
+
diff --git a/plugins/nmap/nmap.plugin.zsh b/plugins/nmap/nmap.plugin.zsh
index f3603f622..d09f2c615 100644
--- a/plugins/nmap/nmap.plugin.zsh
+++ b/plugins/nmap/nmap.plugin.zsh
@@ -22,7 +22,11 @@ alias nmap_fin="nmap -sF -v"
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
alias nmap_ping_through_firewall="nmap -PS -PA"
-alias nmap_fast="nmap -F -T5 --top-ports 300"
+alias nmap_fast="nmap -F -T5 --version-light --top-ports 300"
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vulscan"
+alias nmap_full_udp="nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
+alias nmap_traceroute="nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
+alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "
+alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index 595105d3c..3f6fe0fb3 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -1,8 +1,9 @@
eval "$(npm completion 2>/dev/null)"
+# Install dependencies globally
+alias npmg="npm i -g "
# npm package names are lowercase
-# - https://twitter.com/substack/status/23122603153150361
# Thus, we've used camelCase for the following aliases:
# Install and save to dependencies in your package.json
@@ -12,6 +13,7 @@ alias npmS="npm i -S "
# Install and save to dev-dependencies in your package.json
# npmd is used by https://github.com/dominictarr/npmd
alias npmD="npm i -D "
+
# Execute command from node_modules folder based on current directory
# i.e npmE gulp
alias npmE='PATH="$(npm bin)":"$PATH"'
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 39e388494..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'
@@ -59,7 +60,7 @@ alias rn='rake notes'
alias rr='rake routes'
alias rrg='rake routes | grep'
alias rt='rake test'
-
+alias rmd='rake middleware'
# legacy stuff
alias sstat='thin --stats "/thin/stats" start'
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index 62c6df8f8..a5d63cde6 100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -38,7 +38,6 @@ elif [[ "$OSTYPE" = darwin* ]]; then
break
fi
done
-fi
elif [[ "$OSTYPE" = 'cygwin' ]]; then
local _sublime_cygwin_paths > /dev/null 2>&1
@@ -54,4 +53,6 @@ elif [[ "$OSTYPE" = 'cygwin' ]]; then
fi
done
+fi
+
alias stt='st .'
diff --git a/plugins/systemd/systemd.plugin.zsh b/plugins/systemd/systemd.plugin.zsh
index 07eb595a6..b19793557 100644
--- a/plugins/systemd/systemd.plugin.zsh
+++ b/plugins/systemd/systemd.plugin.zsh
@@ -10,3 +10,7 @@ sudo_commands=(
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
+
+alias sc-enable-now="sc-enable --now"
+alias sc-disable-now="sc-disable --now"
+alias sc-mask-now="sc-mask --now"
diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
index 773c4f8d2..02813de9e 100644
--- a/plugins/textmate/textmate.plugin.zsh
+++ b/plugins/textmate/textmate.plugin.zsh
@@ -1,11 +1,3 @@
-alias et='mate .'
-alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo'
-alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
-alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
-
-# Edit Ruby app in TextMate
-alias mr='mate CHANGELOG app config db lib public script spec test'
-
# If the tm command is called without an argument, open TextMate in the current directory
# If tm is passed a directory, cd to it and open it in TextMate
# If tm is passed a file, open it in TextMate
diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
index b63a857a7..0a2fa0839 100644
--- a/plugins/xcode/xcode.plugin.zsh
+++ b/plugins/xcode/xcode.plugin.zsh
@@ -179,7 +179,10 @@ function simulator {
if [[ -d "${devfolder}/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app" ]]; then
open "${devfolder}/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
# Xcode ≥ 6.x
- else
+ elif [[ -d "${devfolder}/Applications/iOS Simulator.app" ]]; then
open "${devfolder}/Applications/iOS Simulator.app"
+ # Xcode ≥ 7.x
+ else
+ open "${devfolder}/Applications/Simulator.app"
fi
}
diff --git a/tools/uninstall.sh b/tools/uninstall.sh
index 23bfac0eb..f9da00c9b 100644
--- a/tools/uninstall.sh
+++ b/tools/uninstall.sh
@@ -1,3 +1,10 @@
+read -r -p "Are you sure you want to remove Oh My Zsh? [y/N] " confirmation
+if ! [[ $confirmation =~ ^[yY]$ ]]
+then
+ echo "Uninstall cancelled"
+ exit
+fi
+
echo "Removing ~/.oh-my-zsh"
if [ -d ~/.oh-my-zsh ]
then