summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore11
-rw-r--r--LICENSE.txt (renamed from MIT-LICENSE.txt)13
-rw-r--r--README.md (renamed from README.markdown)22
-rw-r--r--cache/.easter-egg4
-rw-r--r--cache/.gitkeep0
-rw-r--r--custom/example.zsh13
-rw-r--r--lib/directories.zsh1
-rw-r--r--lib/functions.zsh10
-rw-r--r--lib/git.zsh91
-rw-r--r--lib/key-bindings.zsh10
-rw-r--r--lib/spectrum.zsh6
-rw-r--r--lib/termsupport.zsh51
-rw-r--r--lib/theme-and-appearance.zsh8
-rw-r--r--log/.easter-egg4
-rw-r--r--log/.gitkeep0
-rw-r--r--plugins/archlinux/archlinux.plugin.zsh14
-rw-r--r--plugins/asdf/README.md27
-rw-r--r--plugins/asdf/asdf.plugin.zsh7
-rw-r--r--plugins/branch/README.md33
-rw-r--r--plugins/branch/branch.plugin.zsh26
-rw-r--r--plugins/brew/_brew56
-rw-r--r--plugins/bundler/README.md1
-rw-r--r--plugins/chruby/chruby.plugin.zsh6
-rw-r--r--plugins/colored-man-pages/colored-man-pages.plugin.zsh36
-rw-r--r--plugins/command-not-found/command-not-found.plugin.zsh8
-rw-r--r--plugins/common-aliases/common-aliases.plugin.zsh2
-rw-r--r--plugins/composer/composer.plugin.zsh4
-rwxr-xr-xplugins/dnf/README.md25
-rw-r--r--plugins/dnf/dnf.plugin.zsh15
-rw-r--r--plugins/ember-cli/README.md24
-rw-r--r--plugins/encode64/encode64.plugin.zsh17
-rw-r--r--plugins/extract/extract.plugin.zsh2
-rw-r--r--plugins/forklift/README.md8
-rw-r--r--plugins/fossil/README.md7
-rw-r--r--plugins/fossil/fossil.plugin.zsh89
-rw-r--r--plugins/frontend-search/README.md2
-rw-r--r--plugins/frontend-search/_frontend-search.sh4
-rw-r--r--plugins/frontend-search/frontend-search.plugin.zsh8
-rw-r--r--plugins/geeknote/README.md12
-rw-r--r--plugins/geeknote/_geeknote136
-rw-r--r--plugins/geeknote/geeknote.plugin.zsh2
-rw-r--r--plugins/git-extras/git-extras.plugin.zsh2
-rw-r--r--plugins/git-flow/git-flow.plugin.zsh2
-rw-r--r--plugins/git/git.plugin.zsh48
-rw-r--r--plugins/github/README.md4
-rw-r--r--plugins/github/_hub163
-rw-r--r--plugins/github/github.plugin.zsh2
-rw-r--r--plugins/gitignore/gitignore.plugin.zsh2
-rw-r--r--plugins/gulp/gulp.plugin.zsh6
-rw-r--r--plugins/history-substring-search/history-substring-search.plugin.zsh9
-rwxr-xr-xplugins/history-substring-search/update-from-upstream.zsh6
-rw-r--r--plugins/jira/jira.plugin.zsh7
-rw-r--r--plugins/mercurial/mercurial.plugin.zsh3
-rw-r--r--plugins/meteor/README.md45
-rw-r--r--plugins/meteor/meteor.plugin.zsh33
-rw-r--r--plugins/mix/_mix4
-rw-r--r--plugins/mvn/README.md32
-rw-r--r--plugins/mvn/mvn.plugin.zsh42
-rw-r--r--plugins/npm/npm.plugin.zsh3
-rw-r--r--plugins/osx/osx.plugin.zsh36
-rw-r--r--plugins/pylint/pylint.plugin.zsh4
-rw-r--r--plugins/rails/rails.plugin.zsh1
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh6
-rw-r--r--plugins/textmate/textmate.plugin.zsh11
-rw-r--r--plugins/tmux-cssh/_tmux-cssh25
-rw-r--r--plugins/vagrant/_vagrant1
-rw-r--r--plugins/vault/README.md18
-rw-r--r--plugins/vault/_vault400
-rw-r--r--plugins/web-search/web-search.plugin.zsh2
-rw-r--r--plugins/wp-cli/README.md4
-rw-r--r--themes/agnoster.zsh-theme3
-rw-r--r--themes/avit.zsh-theme23
-rw-r--r--themes/bira.zsh-theme8
-rw-r--r--themes/bureau.zsh-theme54
-rw-r--r--themes/candy.zsh-theme2
-rw-r--r--themes/eastwood.zsh-theme4
-rw-r--r--themes/fishy.zsh-theme12
-rw-r--r--themes/frontcube.zsh-theme2
-rw-r--r--themes/gallois.zsh-theme6
-rw-r--r--themes/josh.zsh-theme4
-rw-r--r--themes/juanghurtado.zsh-theme4
-rw-r--r--themes/kennethreitz.zsh-theme8
-rw-r--r--themes/mortalscumbag.zsh-theme4
-rw-r--r--themes/peepcode.zsh-theme2
-rw-r--r--themes/robbyrussell.zsh-theme10
-rw-r--r--themes/sunrise.zsh-theme7
-rw-r--r--themes/ys.zsh-theme54
-rw-r--r--tools/upgrade.sh2
88 files changed, 1611 insertions, 334 deletions
diff --git a/.gitignore b/.gitignore
index 8fa66f02f..b2022081a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
-locals.zsh
-log/.zsh_history
-projects.zsh
-custom
+# custom files
+custom/
!custom/plugins/example
!custom/example.zsh
-*.swp
-!custom/example.zshcache
+
+# temp files directories
cache/
+log/
diff --git a/MIT-LICENSE.txt b/LICENSE.txt
index dfbd90035..42f607f5d 100644
--- a/MIT-LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,7 @@
-The MIT License
+The MIT License (MIT)
-Copyright (c) 2009-2015 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
+Copyright (c) 2009-2016 Robby Russell and contributors
+See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.markdown b/README.md
index 6007d6500..5f152e4df 100644
--- a/README.markdown
+++ b/README.md
@@ -1,21 +1,21 @@
-![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
-
+<p align="center">
+ <img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
+</p>
Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
__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 to 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 [ohmyz.sh](http://ohmyz.sh) and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
+To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
-
### Prerequisites
-__Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
+__Disclaimer:__ _Oh My Zsh works best on OS X and Linux._
-* Unix-based operating system (Mac OS X or Linux)
-* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
+* Unix-based operating system (OS X or Linux)
+* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
* `git` should be installed
@@ -26,13 +26,13 @@ Oh My Zsh is installed by running one of the following commands in your terminal
#### via curl
```shell
-sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```
#### via wget
```shell
-sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
+sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
```
## Using Oh My Zsh
@@ -104,7 +104,7 @@ The default location is `~/.oh-my-zsh` (hidden in your home directory)
If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
```shell
-export ZSH="~/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```
#### Manual Installation
@@ -210,4 +210,4 @@ We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-
## License
-Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt).
+Oh My Zsh is released under the [MIT license](LICENSE.txt).
diff --git a/cache/.easter-egg b/cache/.easter-egg
deleted file mode 100644
index 4b6164edb..000000000
--- a/cache/.easter-egg
+++ /dev/null
@@ -1,4 +0,0 @@
-This file is only here so that Git will keep a cache directory as .gitignore is ignoring all the files within it.
-
-Feel free to add love notes for people here.
-
diff --git a/cache/.gitkeep b/cache/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/cache/.gitkeep
diff --git a/custom/example.zsh b/custom/example.zsh
index 28ffcae25..c505a9673 100644
--- a/custom/example.zsh
+++ b/custom/example.zsh
@@ -1,5 +1,10 @@
-# Add yourself some shortcuts to projects you often work on
-# Example:
+# You can put files here to add functionality separated per file, which
+# will be ignored by git.
+# Files on the custom/ directory will be automatically loaded by the init
+# script, in alphabetical order.
+
+# For example: add yourself some shortcuts to projects you often work on.
+#
+# brainstormr=~/Projects/development/planetargon/brainstormr
+# cd $brainstormr
#
-# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
-# \ No newline at end of file
diff --git a/lib/directories.zsh b/lib/directories.zsh
index 3bffa9fd9..a50a692c8 100644
--- a/lib/directories.zsh
+++ b/lib/directories.zsh
@@ -8,6 +8,7 @@ alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
+alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
diff --git a/lib/functions.zsh b/lib/functions.zsh
index ec6f37214..f9d4a9717 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -16,13 +16,17 @@ function take() {
}
function open_command() {
+ emulate -L zsh
+ setopt shwordsplit
+
local open_cmd
# define the open command
case "$OSTYPE" in
- darwin*) open_cmd="open" ;;
- cygwin*) open_cmd="cygstart" ;;
- linux*) open_cmd="xdg-open" ;;
+ darwin*) open_cmd='open' ;;
+ cygwin*) open_cmd='cygstart' ;;
+ linux*) open_cmd='xdg-open' ;;
+ msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
diff --git a/lib/git.zsh b/lib/git.zsh
index 1e203c7c6..1c76d5882 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -1,5 +1,6 @@
-# get the name of the branch we are on
+# Outputs current branch info in prompt format
function git_prompt_info() {
+ local ref
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
@@ -7,9 +8,8 @@ function git_prompt_info() {
fi
}
-
# Checks if working tree is dirty
-parse_git_dirty() {
+function parse_git_dirty() {
local STATUS=''
local FLAGS
FLAGS=('--porcelain')
@@ -29,32 +29,28 @@ parse_git_dirty() {
fi
}
-# get the difference between the local and remote branches
-git_remote_status() {
+# Gets the difference between the local and remote branches
+function git_remote_status() {
+ local remote ahead behind git_remote_status git_remote_status_detailed
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
- if [[ -n ${remote} ]] ; then
+ if [[ -n ${remote} ]]; then
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
- if [ $ahead -eq 0 ] && [ $behind -eq 0 ]
- then
- git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
- elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
- then
+ if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
+ git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
+ elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
- elif [ $behind -gt 0 ] && [ $ahead -eq 0 ]
- then
+ elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
- elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
- then
+ elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi
- if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]
- then
+ if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
fi
@@ -62,9 +58,26 @@ git_remote_status() {
fi
}
+# Outputs the name of the current branch
+# Usage example: git pull origin $(git_current_branch)
+# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
+# it's not a symbolic ref, but in a Git repo.
+function git_current_branch() {
+ local ref
+ ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
+ local ret=$?
+ if [[ $ret != 0 ]]; then
+ [[ $ret == 128 ]] && return # no git repo.
+ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
+ fi
+ echo ${ref#refs/heads/}
+}
+
+
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ local COMMITS
COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
@@ -72,21 +85,21 @@ function git_commits_ahead() {
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
- if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then
+ if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
- if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then
+ if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
- if [[ -n "$(command git show-ref origin/$(current_branch) 2> /dev/null)" ]]; then
+ if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
@@ -95,16 +108,19 @@ function git_prompt_remote() {
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
+ local SHA
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
+ local SHA
SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
-git_prompt_status() {
+function git_prompt_status() {
+ local INDEX STATUS
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
@@ -150,15 +166,14 @@ git_prompt_status() {
echo $STATUS
}
-#compare the provided version of git to the version installed and on path
-#prints 1 if input version <= installed version
-#prints -1 otherwise
+# Compares the provided version of git to the version installed and on path
+# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
+# greater than the input version, respectively.
function git_compare_version() {
- local INPUT_GIT_VERSION=$1;
- local INSTALLED_GIT_VERSION
- INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
- INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null));
- INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
+ local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
+ INPUT_GIT_VERSION=(${(s/./)1})
+ INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
+ INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
@@ -173,7 +188,19 @@ function git_compare_version() {
echo 0
}
-#this is unlikely to change so make it all statically assigned
+# Outputs the name of the current user
+# Usage example: $(git_current_user_name)
+function git_current_user_name() {
+ command git config user.name 2>/dev/null
+}
+
+# Outputs the email of the current user
+# Usage example: $(git_current_user_email)
+function git_current_user_email() {
+ command git config user.email 2>/dev/null
+}
+
+# This is unlikely to change so make it all statically assigned
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
-#clean up the namespace slightly by removing the checker function
-unset -f git_compare_version
+# Clean up the namespace slightly by removing the checker function
+unfunction git_compare_version
diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
index eb2b58058..0e056dc72 100644
--- a/lib/key-bindings.zsh
+++ b/lib/key-bindings.zsh
@@ -27,11 +27,17 @@ if [[ "${terminfo[knp]}" != "" ]]; then
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
fi
+# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
- bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
+ autoload -U up-line-or-beginning-search
+ zle -N up-line-or-beginning-search
+ bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
+# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
- bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
+ autoload -U down-line-or-beginning-search
+ zle -N down-line-or-beginning-search
+ bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
if [[ "${terminfo[khome]}" != "" ]]; then
diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
index b683aca29..87092d8ae 100644
--- a/lib/spectrum.zsh
+++ b/lib/spectrum.zsh
@@ -3,7 +3,7 @@
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
-typeset -Ag FX FG BG
+typeset -AHg FX FG BG
FX=(
reset "%{%}"
@@ -25,13 +25,13 @@ ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab o
# Show all 256 colors with color number
function spectrum_ls() {
for code in {000..255}; do
- print -P -- "$code: %F{$code}$ZSH_SPECTRUM_TEXT%f"
+ print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
for code in {000..255}; do
- print -P -- "$BG[$code]$code: $ZSH_SPECTRUM_TEXT %{$reset_color%}"
+ print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 4c5068e9b..871ab28df 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -9,32 +9,50 @@
function title {
emulate -L zsh
setopt prompt_subst
-
+
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
: ${2=$1}
- if [[ "$TERM" == screen* ]]; then
- 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
- fi
+ case "$TERM" in
+ cygwin|xterm*|putty*|rxvt*|ansi)
+ print -Pn "\e]2;$2:q\a" # set window name
+ print -Pn "\e]1;$1:q\a" # set tab name
+ ;;
+ screen*)
+ print -Pn "\ek$1:q\e\\" # set screen hardstatus
+ ;;
+ *)
+ if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ print -Pn "\e]2;$2:q\a" # set window name
+ print -Pn "\e]1;$1:q\a" # set tab name
+ else
+ # Try to use terminfo to set the title
+ # If the feature is available set title
+ if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
+ echoti tsl
+ print -Pn "$1"
+ echoti fsl
+ fi
+ fi
+ ;;
+ esac
}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
-if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
+if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt
function omz_termsupport_precmd {
emulate -L zsh
- if [[ $DISABLE_AUTO_TITLE == true ]]; then
+
+ if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
@@ -44,12 +62,12 @@ function omz_termsupport_precmd {
# Runs before executing the command
function omz_termsupport_preexec {
emulate -L zsh
- if [[ $DISABLE_AUTO_TITLE == true ]]; then
+ setopt extended_glob
+
+ if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
- setopt extended_glob
-
# cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
@@ -66,19 +84,18 @@ preexec_functions+=(omz_termsupport_preexec)
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
-
# Emits the control sequence to notify Terminal.app of the cwd
+ # Identifies the directory using a file: URI scheme, including
+ # the host name to disambiguate local vs. remote paths.
function update_terminalapp_cwd() {
emulate -L zsh
- # Identify the directory using a "file:" scheme URL, including
- # the host name to disambiguate local vs. remote paths.
# Percent-encode the pathname.
local URL_PATH="$(omz_urlencode -P $PWD)"
[[ $? != 0 ]] && return 1
- local PWD_URL="file://$HOST$URL_PATH"
+
# Undocumented Terminal.app-specific control sequence
- printf '\e]7;%s\a' $PWD_URL
+ printf '\e]7;%s\a' "file://$HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index ebb11fb31..5c5bb0e6d 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -11,9 +11,9 @@ then
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
elif [[ "$(uname -s)" == "OpenBSD" ]]; then
- # On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
- # with color and multibyte support) are available from ports. "colorls"
- # will be installed on purpose and can't be pulled in by installing
+ # On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
+ # with color and multibyte support) are available from ports. "colorls"
+ # will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
@@ -22,10 +22,8 @@ then
fi
fi
-#setopt no_beep
setopt auto_cd
setopt multios
-setopt cdablevars
if [[ x$WINDOW != x ]]
then
diff --git a/log/.easter-egg b/log/.easter-egg
deleted file mode 100644
index 2533149e2..000000000
--- a/log/.easter-egg
+++ /dev/null
@@ -1,4 +0,0 @@
-This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it.
-
-feel free to add love notes for people here.
-
diff --git a/log/.gitkeep b/log/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/log/.gitkeep
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index b83c24560..99de5b936 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -2,7 +2,7 @@
# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
# Look for yaourt, and add some useful functions if we have it.
-if [[ -x `command -v yaourt` ]]; then
+if (( $+commands[yaourt] )); then
upgrade () {
yaourt -Syu
}
@@ -21,11 +21,11 @@ if [[ -x `command -v yaourt` ]]; then
alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local")
alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
# Additional yaourt alias examples
- if [[ -x `command -v abs` && -x `command -v aur` ]]; then
+ if (( $+commands[abs] && $+commands[aur] )); then
alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
- elif [[ -x `command -v abs` ]]; then
+ elif (( $+commands[abs] )); then
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
- elif [[ -x `command -v aur` ]]; then
+ elif (( $+commands[aur] )); then
alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else
alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
@@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
alias pacloc='pacman -Qi' # Display information about a given package in the local database
alias paclocs='pacman -Qs' # Search for package(s) in the local database
# Additional pacman alias examples
-if [[ -x `command -v abs` && -x `command -v aur` ]]; then
+if (( $+commands[abs] && $+commands[aur] )); then
alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
-elif [[ -x `command -v abs` ]]; then
+elif (( $+commands[abs] )); then
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
-elif [[ -x `command -v aur` ]]; then
+elif (( $+commands[aur] )); then
alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else
alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md
new file mode 100644
index 000000000..e8aa976bc
--- /dev/null
+++ b/plugins/asdf/README.md
@@ -0,0 +1,27 @@
+## asdf
+
+**Maintainer:** [@RobLoach](https://github.com/RobLoach)
+
+Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more.
+
+### Installation
+
+1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`.
+
+ ```
+ plugins=(asdf)
+ ```
+
+2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following:
+ ```
+ git clone https://github.com/asdf-vm/asdf.git ~/.asdf
+ ```
+
+### Usage
+
+See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf:
+
+```
+asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git
+asdf install nodejs 5.9.1
+```
diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
new file mode 100644
index 000000000..8736d2ff8
--- /dev/null
+++ b/plugins/asdf/asdf.plugin.zsh
@@ -0,0 +1,7 @@
+# Find where asdf should be installed.
+ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
+
+# Load asdf, if found.
+if [ -f $ASDF_DIR/asdf.sh ]; then
+ . $ASDF_DIR/asdf.sh
+fi
diff --git a/plugins/branch/README.md b/plugins/branch/README.md
new file mode 100644
index 000000000..56ab8da4b
--- /dev/null
+++ b/plugins/branch/README.md
@@ -0,0 +1,33 @@
+# Branch
+
+Displays the current Git or Mercurial branch fast.
+
+## Speed test
+
+### Mercurial
+
+```shell
+$ time hg branch
+0.11s user 0.14s system 70% cpu 0.355 total
+```
+
+### Branch plugin
+
+```shell
+$ time zsh /tmp/branch_prompt_info_test.zsh
+0.00s user 0.01s system 78% cpu 0.014 total
+```
+
+## Usage
+
+Edit your theme file (eg.: `~/.oh-my-zsh/theme/robbyrussell.zsh-theme`)
+adding `$(branch_prompt_info)` in your prompt like this:
+
+```diff
+- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
++ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(branch_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+```
+
+## Maintainer
+
+Victor Torres (<vpaivatorres@gmail.com>)
diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh
new file mode 100644
index 000000000..a1e9ca31b
--- /dev/null
+++ b/plugins/branch/branch.plugin.zsh
@@ -0,0 +1,26 @@
+# Branch: displays the current Git or Mercurial branch fast.
+# Victor Torres <vpaivatorres@gmail.com>
+# Oct 2, 2015
+
+function branch_prompt_info() {
+ # Defines path as current directory
+ local current_dir=$PWD
+ # While current path is not root path
+ while [[ $current_dir != '/' ]]
+ do
+ # Git repository
+ if [[ -d "${current_dir}/.git" ]]
+ then
+ echo '±' ${"$(<"$current_dir/.git/HEAD")"##*/}
+ return;
+ fi
+ # Mercurial repository
+ if [[ -d "${current_dir}/.hg" ]]
+ then
+ echo '☿' $(<"$current_dir/.hg/branch")
+ return;
+ fi
+ # Defines path as parent directory and keeps looking for :)
+ current_dir="${current_dir:h}"
+ done
+}
diff --git a/plugins/brew/_brew b/plugins/brew/_brew
index 4c99a383a..1f24bd67b 100644
--- a/plugins/brew/_brew
+++ b/plugins/brew/_brew
@@ -1,7 +1,13 @@
#compdef brew
#autoload
-# imported from the latest homebrew contributions
+# imported from https://github.com/Homebrew/homebrew/blob/29f73d2212c2b202fe25f69dcbf440d8391fa4c9/Library/Contributions/brew_zsh_completion.zsh
+
+# Brew ZSH completion function
+# Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions)
+# and rename it _brew
+#
+# altered from _fink
_brew_all_formulae() {
formulae=(`brew search`)
@@ -15,6 +21,14 @@ _brew_installed_taps() {
installed_taps=(`brew tap`)
}
+_brew_official_taps() {
+ official_taps=(`brew tap --list-official`)
+}
+
+_brew_pinned_taps() {
+ pinned_taps=(`brew tap --list-pinned`)
+}
+
_brew_outdated_formulae() {
outdated_formulae=(`brew outdated`)
}
@@ -25,8 +39,10 @@ _1st_arguments=(
'cat:display formula file for a formula'
'cleanup:uninstall unused and old versions of packages'
'commands:show a list of commands'
+ 'config:show homebrew and system configuration'
'create:create a new formula'
- 'deps:list dependencies of a formula'
+ 'deps:list dependencies and dependants of a formula'
+ 'desc:display a description of a formula'
'doctor:audits your installation for common issues'
'edit:edit a formula'
'fetch:download formula resources to the cache'
@@ -37,40 +53,45 @@ _1st_arguments=(
'reinstall:install a formula anew; re-using its current options'
'leaves:show installed formulae that are not dependencies of another installed formula'
'link:link a formula'
+ 'linkapps:symlink .app bundles provided by formulae into /Applications'
'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula'
'missing:check all installed formuale for missing dependencies.'
+ 'migrate:migrate renamed formula to new name'
'outdated:list formulae for which a newer version is available'
'pin:pin specified formulae'
'postinstall:perform post_install for a given formula'
'prune:remove dead links'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
- 'switch:switch linkage between installed versions of a formula'
+ 'switch:switch between different versions of a formula'
'tap:tap a new formula repository from GitHub, or list existing taps'
+ 'tap-info:information about a tap'
+ 'tap-pin:pin a tap'
+ 'tap-unpin:unpin a tap'
'test-bot:test a formula and build a bottle'
'uninstall:uninstall a formula'
'unlink:unlink a formula'
+ 'unlinkapps:remove symlinked .app bundles provided by formulae from /Applications'
'unpin:unpin specified formulae'
'untap:remove a tapped repository'
- 'update:pull latest repository'
+ 'update:fetch latest version of Homebrew and all formulae'
'upgrade:upgrade outdated formulae'
'uses:show formulae which depend on a formula'
+ `brew commands --quiet --include-aliases`
)
local expl
-local -a formulae installed_formulae installed_taps outdated_formulae
+local -a formulae installed_formulae installed_taps official_taps outdated_formulae
_arguments \
'(-v)-v[verbose]' \
'(--cellar)--cellar[brew cellar]' \
- '(--config)--config[brew configuration]' \
'(--env)--env[brew environment]' \
'(--repository)--repository[brew repository]' \
'(--version)--version[version information]' \
'(--prefix)--prefix[where brew lives on this system]' \
'(--cache)--cache[brew cache]' \
- '(--force)--force[brew force]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
@@ -79,9 +100,18 @@ if (( CURRENT == 1 )); then
fi
case "$words[1]" in
- install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+ install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|desc|edit|options|switch)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
+ linkapps|unlinkapps)
+ _arguments \
+ '(--local)--local[operate on ~/Applications instead of /Applications]' \
+ '1: :->forms' && return 0
+
+ if [[ "$state" == forms ]]; then
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
+ fi ;;
list|ls)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
@@ -100,9 +130,15 @@ case "$words[1]" in
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
- untap)
+ untap|tap-info|tap-pin)
_brew_installed_taps
- _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
+ _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
+ tap)
+ _brew_official_taps
+ _wanted official_taps expl 'official taps' compadd -a official_taps ;;
+ tap-unpin)
+ _brew_pinned_taps
+ _wanted pinned_taps expl 'pinned taps' compadd -a pinned_taps ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
index edd95ccc2..04d551447 100644
--- a/plugins/bundler/README.md
+++ b/plugins/bundler/README.md
@@ -6,6 +6,7 @@
- `bl` aliased to `bundle list`
- `bp` aliased to `bundle package`
- `bo` aliased to `bundle open`
+ - `bout` aliased to `bundle outdated`
- `bu` aliased to `bundle update`
- `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
- adds a wrapper for common gems:
diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
index 164b4319f..758b4a56c 100644
--- a/plugins/chruby/chruby.plugin.zsh
+++ b/plugins/chruby/chruby.plugin.zsh
@@ -16,9 +16,6 @@
# rvm and rbenv plugins also provide this alias
alias rubies='chruby'
-local _chruby_path
-local _chruby_auto
-
_homebrew-installed() {
whence brew &> /dev/null
}
@@ -42,6 +39,9 @@ if _ruby-build_installed; then
fi
_source_from_omz_settings() {
+ local _chruby_path
+ local _chruby_auto
+
zstyle -s :omz:plugins:chruby path _chruby_path
zstyle -s :omz:plugins:chruby auto _chruby_auto
diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index 5c613f49d..54f0bdda9 100644
--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
@@ -1,32 +1,32 @@
-if [ "$OSTYPE[0,7]" = "solaris" ]
+if [[ "$OSTYPE" = solaris* ]]
then
- if [ ! -x ${HOME}/bin/nroff ]
+ if [[ ! -x "$HOME/bin/nroff" ]]
then
- mkdir -p ${HOME}/bin
- cat > ${HOME}/bin/nroff <<EOF
+ mkdir -p "$HOME/bin"
+ cat > "$HOME/bin/nroff" <<EOF
#!/bin/sh
if [ -n "\$_NROFF_U" -a "\$1,\$2,\$3" = "-u0,-Tlp,-man" ]; then
shift
- exec /usr/bin/nroff -u\${_NROFF_U} "\$@"
+ exec /usr/bin/nroff -u\$_NROFF_U "\$@"
fi
#-- Some other invocation of nroff
exec /usr/bin/nroff "\$@"
EOF
- chmod +x ${HOME}/bin/nroff
+ chmod +x "$HOME/bin/nroff"
fi
fi
man() {
- env \
- LESS_TERMCAP_mb=$(printf "\e[1;31m") \
- LESS_TERMCAP_md=$(printf "\e[1;31m") \
- LESS_TERMCAP_me=$(printf "\e[0m") \
- LESS_TERMCAP_se=$(printf "\e[0m") \
- LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
- LESS_TERMCAP_ue=$(printf "\e[0m") \
- LESS_TERMCAP_us=$(printf "\e[1;32m") \
- PAGER=/usr/bin/less \
- _NROFF_U=1 \
- PATH=${HOME}/bin:${PATH} \
- man "$@"
+ env \
+ LESS_TERMCAP_mb=$(printf "\e[1;31m") \
+ LESS_TERMCAP_md=$(printf "\e[1;31m") \
+ LESS_TERMCAP_me=$(printf "\e[0m") \
+ LESS_TERMCAP_se=$(printf "\e[0m") \
+ LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
+ LESS_TERMCAP_ue=$(printf "\e[0m") \
+ LESS_TERMCAP_us=$(printf "\e[1;32m") \
+ PAGER="${commands[less]:-$PAGER}" \
+ _NROFF_U=1 \
+ PATH="$HOME/bin:$PATH" \
+ man "$@"
}
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
index 797554a13..0e2f2133f 100644
--- a/plugins/command-not-found/command-not-found.plugin.zsh
+++ b/plugins/command-not-found/command-not-found.plugin.zsh
@@ -23,3 +23,11 @@ if [ -f /usr/libexec/pk-command-not-found ]; then
return $retval
}
fi
+
+# OSX command-not-found support
+# https://github.com/Homebrew/homebrew-command-not-found
+if type brew &> /dev/null; then
+ if brew command command-not-found-init > /dev/null 2>&1; then
+ eval "$(brew command-not-found-init)";
+ fi
+fi
diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh
index fc19d73c3..c7aafd8b8 100644
--- a/plugins/common-aliases/common-aliases.plugin.zsh
+++ b/plugins/common-aliases/common-aliases.plugin.zsh
@@ -52,7 +52,7 @@ alias mv='mv -i'
# zsh is able to auto-do some kungfoo
# depends on the SUFFIX :)
-if [ ${ZSH_VERSION//\./} -ge 420 ]; then
+if is-at-least 4.2.0; then
# open browser on urls
_browser_fts=(htm html de org net com at cx nl se dk dk php)
for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done
diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
index 86f5be3d0..07eb1de88 100644
--- a/plugins/composer/composer.plugin.zsh
+++ b/plugins/composer/composer.plugin.zsh
@@ -7,11 +7,11 @@
# Composer basic command completion
_composer_get_command_list () {
- $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
+ $_comp_command1 --no-ansi 2>/dev/null | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
}
_composer_get_required_list () {
- $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
+ $_comp_command1 show -s --no-ansi 2>/dev/null | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
}
_composer () {
diff --git a/plugins/dnf/README.md b/plugins/dnf/README.md
new file mode 100755
index 000000000..f9ef496fa
--- /dev/null
+++ b/plugins/dnf/README.md
@@ -0,0 +1,25 @@
+## Description
+
+This plugin makes `dnf` usage easier by adding aliases for the most
+common commands.
+
+`dnf` is the new package manager for RPM-based distributions, which
+replaces `yum`.
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|-------------------------|--------------------------|
+| dnfl | `dnf list` | List packages |
+| dnfli | `dnf list installed` | List installed packages |
+| dnfgl | `dnf grouplist` | List package groups |
+| dnfmc | `dnf makecache` | Generate metadata cache |
+| dnfp | `dnf info` | Show package information |
+| dnfs | `dnf search` | Search package |
+| **Use `sudo`** |
+| dnfu | `sudo dnf upgrade` | Upgrade package |
+| dnfi | `sudo dnf install` | Install package |
+| dnfgi | `sudo dnf groupinstall` | Install package group |
+| dnfr | `sudo dnf remove` | Remove package |
+| dnfgr | `sudo dnf groupremove` | Remove package group |
+| dnfc | `sudo dnf clean all` | Clean cache |
diff --git a/plugins/dnf/dnf.plugin.zsh b/plugins/dnf/dnf.plugin.zsh
new file mode 100644
index 000000000..653ce7dda
--- /dev/null
+++ b/plugins/dnf/dnf.plugin.zsh
@@ -0,0 +1,15 @@
+## Aliases
+
+alias dnfl="dnf list" # List packages
+alias dnfli="dnf list installed" # List installed packages
+alias dnfgl="dnf grouplist" # List package groups
+alias dnfmc="dnf makecache" # Generate metadata cache
+alias dnfp="dnf info" # Show package information
+alias dnfs="dnf search" # Search package
+
+alias dnfu="sudo dnf upgrade" # Upgrade package
+alias dnfi="sudo dnf install" # Install package
+alias dnfgi="sudo dnf groupinstall" # Install package group
+alias dnfr="sudo dnf remove" # Remove package
+alias dnfgr="sudo dnf groupremove" # Remove package group
+alias dnfc="sudo dnf clean all" # Clean cache
diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md
index 482c347d2..1f92bba32 100644
--- a/plugins/ember-cli/README.md
+++ b/plugins/ember-cli/README.md
@@ -6,14 +6,16 @@ Ember CLI (http://www.ember-cli.com/)
### List of Aliases
- alias es='ember serve'
- alias ea='ember addon'
- alias eb='ember build'
- alias ed='ember destroy'
- alias eg='ember generate'
- alias eh='ember help'
- alias ein='ember init'
- alias ei='ember install'
- alias et='ember test'
- alias eu='ember update'
- alias ev='ember version'
+Alias | Ember-CLI command
+----- | -----------------
+**es** | *ember serve*
+**ea** | *ember addon*
+**eb** | *ember build*
+**ed** | *ember destroy*
+**eg** | *ember generate*
+**eh** | *ember help*
+**ein** | *ember init*
+**ei** | *ember install*
+**et** | *ember test*
+**eu** | *ember update*
+**ev** | *ember version*
diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh
index 53de6478a..979e06742 100644
--- a/plugins/encode64/encode64.plugin.zsh
+++ b/plugins/encode64/encode64.plugin.zsh
@@ -1,4 +1,17 @@
-encode64(){ printf '%s' $1 | base64 }
-decode64(){ printf '%s' $1 | base64 --decode }
+encode64() {
+ if [[ $# -eq 0 ]]; then
+ cat | base64
+ else
+ printf '%s' $1 | base64
+ fi
+}
+
+decode64() {
+ if [[ $# -eq 0 ]]; then
+ cat | base64 --decode
+ else
+ printf '%s' $1 | base64 --decode
+ fi
+}
alias e64=encode64
alias d64=decode64
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 690126ba6..5d0809e9a 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -52,7 +52,7 @@ function extract() {
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
- (*.zip|*.war|*.jar|*.sublime-package|*.ipsw) unzip "$1" -d $extract_dir ;;
+ (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
diff --git a/plugins/forklift/README.md b/plugins/forklift/README.md
index b452a357c..6c5cbab23 100644
--- a/plugins/forklift/README.md
+++ b/plugins/forklift/README.md
@@ -4,10 +4,12 @@ Plugin for ForkLift, an FTP application for OS X.
### Requirements
-* [ForkLift](http://forkliftapp.com/forklift/)
+* [ForkLift](http://www.binarynights.com/forklift/)
### Usage
-* If `fl` is called without arguments then the current folder is opened in ForkLift. Is equivalent to `fl .`
+<code>fl [*file_or_folder*]</code>
-* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift \ No newline at end of file
+* If `fl` is called without arguments then the current folder is opened in ForkLift. This is equivalent to `fl .`.
+
+* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift. If called with a non-directory file as the argument, then the file's parent directory is opened.
diff --git a/plugins/fossil/README.md b/plugins/fossil/README.md
new file mode 100644
index 000000000..5bb47b7d5
--- /dev/null
+++ b/plugins/fossil/README.md
@@ -0,0 +1,7 @@
+## Fossil Plugin
+
+This plugin adds completion support and prompt for fossil repositories.
+The prompt will display the current branch and status been dirty or clean.
+
+### CONTRIBUTOR
+ - Jefferson González ([jgmdev](https://github.com/jgmdev))
diff --git a/plugins/fossil/fossil.plugin.zsh b/plugins/fossil/fossil.plugin.zsh
new file mode 100644
index 000000000..1ae166e62
--- /dev/null
+++ b/plugins/fossil/fossil.plugin.zsh
@@ -0,0 +1,89 @@
+_FOSSIL_PROMPT=""
+
+# Prefix at the very beginning of the prompt, before the branch name
+ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}"
+
+# At the very end of the prompt
+ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})"
+
+# Text to display if the branch is dirty
+ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"
+
+# Text to display if the branch is clean
+ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
+
+function fossil_prompt_info () {
+ local _OUTPUT=`fossil branch 2>&1`
+ local _STATUS=`echo $_OUTPUT | grep "use --repo"`
+ if [ "$_STATUS" = "" ]; then
+ local _EDITED=`fossil changes`
+ local _EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
+ local _BRANCH=`echo $_OUTPUT | grep "* " | sed 's/* //g'`
+
+ if [ "$_EDITED" != "" ]; then
+ _EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_DIRTY"
+ fi
+
+ echo "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \
+ "$_BRANCH" \
+ "$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \
+ "$_EDITED_SYM"\
+ "%{$reset_color%}"
+ fi
+}
+
+function _fossil_get_command_list () {
+ fossil help -a | grep -v "Usage|Common|This is"
+}
+
+function _fossil () {
+ local context state state_descr line
+ typeset -A opt_args
+
+ _arguments \
+ '1: :->command'\
+ '2: :->subcommand'
+
+ case $state in
+ command)
+ local _OUTPUT=`fossil branch 2>&1 | grep "use --repo"`
+ if [ "$_OUTPUT" = "" ]; then
+ compadd `_fossil_get_command_list`
+ else
+ compadd clone init import help version
+ fi
+ ;;
+ subcommand)
+ if [ "$words[2]" = "help" ]; then
+ compadd `_fossil_get_command_list`
+ else
+ compcall -D
+ fi
+ ;;
+ esac
+}
+
+function _fossil_prompt () {
+ local current=`echo $PROMPT $RPROMPT | grep fossil`
+
+ if [ "$_FOSSIL_PROMPT" = "" -o "$current" = "" ]; then
+ local _prompt=${PROMPT}
+ local _rprompt=${RPROMPT}
+
+ local is_prompt=`echo $PROMPT | grep git`
+
+ if [ "$is_prompt" = "" ]; then
+ export RPROMPT="$_rprompt"'$(fossil_prompt_info)'
+ else
+ export PROMPT="$_prompt"'$(fossil_prompt_info) '
+ fi
+
+ _FOSSIL_PROMPT="1"
+ fi
+}
+
+compdef _fossil fossil
+
+autoload -U add-zsh-hook
+
+add-zsh-hook precmd _fossil_prompt
diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
index d0bc5589f..4d956e38f 100644
--- a/plugins/frontend-search/README.md
+++ b/plugins/frontend-search/README.md
@@ -38,7 +38,7 @@ Available search contexts are:
| bootsnipp | `http://bootsnipp.com/search?q=` |
| caniuse | `http://caniuse.com/#search=` |
| codepen | `http://codepen.io/search?q=` |
-| compass | `http://compass-style.org/search?q=` |
+| compassdoc | `http://compass-style.org/search?q=` |
| cssflow | `http://www.cssflow.com/search?q=` |
| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` |
| emberjs | `http://emberjs.com/api/#stp=1&stq=` |
diff --git a/plugins/frontend-search/_frontend-search.sh b/plugins/frontend-search/_frontend-search.sh
index b12f829a1..9aad76f76 100644
--- a/plugins/frontend-search/_frontend-search.sh
+++ b/plugins/frontend-search/_frontend-search.sh
@@ -19,7 +19,7 @@ function _frontend() {
commands=(
'jquery: Search in jQuery website'
'mdn: Search in MDN website'
- 'compass: Search in COMPASS website'
+ 'compassdoc: Search in COMPASS website'
'html5please: Search in HTML5 Please website'
'caniuse: Search in Can I Use website'
'aurajs: Search in AuraJs website'
@@ -57,7 +57,7 @@ function _frontend() {
mdn)
_describe -t points "Warp points" frontend_points && ret=0
;;
- compass)
+ compassdoc)
_describe -t points "Warp points" frontend_points && ret=0
;;
html5please)
diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
index 2fd5416b3..3fd49ab8e 100644
--- a/plugins/frontend-search/frontend-search.plugin.zsh
+++ b/plugins/frontend-search/frontend-search.plugin.zsh
@@ -4,7 +4,7 @@ alias bem='frontend bem'
alias bootsnipp='frontend bootsnipp'
alias caniuse='frontend caniuse'
alias codepen='frontend codepen'
-alias compass='frontend compass'
+alias compassdoc='frontend compassdoc'
alias cssflow='frontend cssflow'
alias dartlang='frontend dartlang'
alias emberjs='frontend emberjs'
@@ -32,7 +32,7 @@ function frontend() {
bootsnipp 'http://bootsnipp.com/search?q='
caniuse 'http://caniuse.com/#search='
codepen 'http://codepen.io/search?q='
- compass 'http://compass-style.org/search?q='
+ compassdoc 'http://compass-style.org/search?q='
cssflow 'http://www.cssflow.com/search?q='
dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
emberjs 'http://emberjs.com/api/#stp=1&stq='
@@ -57,7 +57,7 @@ function frontend() {
print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
print -P "and %Ucontext%u is one of the following:"
print -P ""
- print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compass, cssflow,"
+ print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
print -P " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs,"
print -P " qunit, reactjs, smacss, stackoverflow, unheap"
print -P ""
@@ -73,7 +73,7 @@ function frontend() {
echo ""
echo "Valid contexts are:"
echo ""
- echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compass, cssflow, "
+ echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, "
echo " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs, "
echo " qunit, reactjs, smacss, stackoverflow, unheap"
echo ""
diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md
new file mode 100644
index 000000000..a6b50e27f
--- /dev/null
+++ b/plugins/geeknote/README.md
@@ -0,0 +1,12 @@
+## ZSH-Geeknote
+
+[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh).
+
+Plugins provides:
+
+- auto completion of commands and their options
+- alias `gn`
+
+You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/).
+
+Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley))
diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote
new file mode 100644
index 000000000..cf1a187d2
--- /dev/null
+++ b/plugins/geeknote/_geeknote
@@ -0,0 +1,136 @@
+#compdef geeknote
+# --------------- ------------------------------------------------------------
+# Name : _geeknote
+# Synopsis : zsh completion for geeknote
+# Author : Ján Koščo <3k.stanley@gmail.com>
+# HomePage : http://www.geeknote.me
+# Version : 0.1
+# Tag : [ shell, zsh, completion, evernote ]
+# Copyright : © 2014 by Ján Koščo,
+# Released under current GPL license.
+# --------------- ------------------------------------------------------------
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'login'
+ 'logout'
+ 'settings'
+ 'create'
+ 'edit'
+ 'find'
+ 'show'
+ 'remove'
+ 'notebook-list'
+ 'notebook-create'
+ 'notebook-edit'
+ 'tag-list'
+ 'tag-create'
+ 'tag-edit'
+ 'tag-remove'
+ 'gnsync'
+ 'user'
+)
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "geeknote command" _1st_arguments
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ user)
+ _command_args=(
+ '(--full)--full' \
+ )
+ ;;
+ logout)
+ _command_args=(
+ '(--force)--force' \
+ )
+ ;;
+ settings)
+ _command_args=(
+ '(--editor)--editor' \
+ )
+ ;;
+ create)
+ _command_args=(
+ '(-t|--title)'{-t,--title}'[note title]' \
+ '(-c|--content)'{-c,--content}'[note content]' \
+ '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
+ '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
+ )
+ ;;
+ edit)
+ _command_args=(
+ '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
+ '(-t|--title)'{-t,--title}'[note title]' \
+ '(-c|--content)'{-c,--content}'[note content]' \
+ '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
+ '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
+ )
+ ;;
+ remove)
+ _command_args=(
+ '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
+ '(--force)--force' \
+ )
+ ;;
+ show)
+ _command_args=(
+ '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
+ )
+ ;;
+ find)
+ _command_args=(
+ '(-s|--search)'{-s,--search}'[text to search]' \
+ '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \
+ '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \
+ '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \
+ '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \
+ '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \
+ '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \
+ '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \
+ )
+ ;;
+ notebook-create)
+ _command_args=(
+ '(-t|--title)'{-t,--title}'[notebook title]' \
+ )
+ ;;
+ notebook-edit)
+ _command_args=(
+ '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \
+ '(-t|--title)'{-t,--title}'[new notebook title]' \
+ )
+ ;;
+ notebook-remove)
+ _command_args=(
+ '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \
+ '(--force)--force' \
+ )
+ ;;
+ tag-create)
+ _command_args=(
+ '(-t|--title)'{-t,--title}'[title of tag]' \
+ )
+ ;;
+ tag-edit)
+ _command_args=(
+ '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \
+ '(-t|--title)'{-t,--title}'[new tag name]' \
+ )
+ ;;
+ tag-remove)
+ _command_args=(
+ '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \
+ '(--force)--force' \
+ )
+ ;;
+ esac
+
+_arguments \
+ $_command_args \
+ && return 0
diff --git a/plugins/geeknote/geeknote.plugin.zsh b/plugins/geeknote/geeknote.plugin.zsh
new file mode 100644
index 000000000..8126d26b3
--- /dev/null
+++ b/plugins/geeknote/geeknote.plugin.zsh
@@ -0,0 +1,2 @@
+#Alias
+alias gn='geeknote'
diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
index 507bf1b25..0dcd630e8 100644
--- a/plugins/git-extras/git-extras.plugin.zsh
+++ b/plugins/git-extras/git-extras.plugin.zsh
@@ -4,7 +4,7 @@
#
# Completion script for git-extras (http://github.com/tj/git-extras).
#
-# This depends on and reueses some of the internals of the _git completion
+# This depends on and reuses 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.
#
diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
index 444440bcb..a8386cb19 100644
--- a/plugins/git-flow/git-flow.plugin.zsh
+++ b/plugins/git-flow/git-flow.plugin.zsh
@@ -6,7 +6,7 @@
# To achieve git-flow completion nirvana:
#
# 0. Update your zsh's git-completion module to the newest version.
-# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
+# From here. https://raw.githubusercontent.com/zsh-users/zsh/master/Completion/Unix/Command/_git
#
# 1. Install this file. Either:
#
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index d78b82df3..34f69029a 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -6,19 +6,12 @@ zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd
# Functions
#
-# The current branch name
-# Usage example: git pull origin $(current_branch)
-# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
-# it's not a symbolic ref, but in a Git repo.
+# The name of the current branch
+# Back-compatibility wrapper for when this function was defined here in
+# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
+# to fix the core -> git plugin dependency.
function current_branch() {
- local ref
- ref=$($_omz_git_git_cmd symbolic-ref --quiet HEAD 2> /dev/null)
- local ret=$?
- if [[ $ret != 0 ]]; then
- [[ $ret == 128 ]] && return # no git repo.
- ref=$($_omz_git_git_cmd rev-parse --short HEAD 2> /dev/null) || return
- fi
- echo ${ref#refs/heads/}
+ git_current_branch
}
# The list of remotes
function current_repository() {
@@ -65,9 +58,11 @@ alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
+alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
-alias gcan!='git commit -v -a -s --no-edit --amend'
+alias gcan!='git commit -v -a --no-edit --amend'
+alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
@@ -99,7 +94,7 @@ alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
ggf() {
-[[ "$#" != 1 ]] && local b="$(current_branch)"
+[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force origin "${b:=$1}"
}
compdef _git ggf=git-checkout
@@ -107,23 +102,23 @@ ggl() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git pull origin "${*}"
else
-[[ "$#" == 0 ]] && local b="$(current_branch)"
+[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git pull origin "${b:=$1}"
fi
}
compdef _git ggl=git-checkout
-alias ggpull='git pull origin $(current_branch)'
+alias ggpull='git pull origin $(git_current_branch)'
compdef _git ggpull=git-checkout
ggp() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git push origin "${*}"
else
-[[ "$#" == 0 ]] && local b="$(current_branch)"
+[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git push origin "${b:=$1}"
fi
}
compdef _git ggp=git-checkout
-alias ggpush='git push origin $(current_branch)'
+alias ggpush='git push origin $(git_current_branch)'
compdef _git ggpush=git-checkout
ggpnp() {
if [[ "$#" == 0 ]]; then
@@ -133,9 +128,9 @@ ggl "${*}" && ggp "${*}"
fi
}
compdef _git ggpnp=git-checkout
-alias ggsup='git branch --set-upstream-to=origin/$(current_branch)'
+alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
ggu() {
-[[ "$#" != 1 ]] && local b="$(current_branch)"
+[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
@@ -153,15 +148,16 @@ alias gke='\gitk --all $(git log -g --pretty=format:%h)'
compdef _git gke='gitk'
alias gl='git pull'
-alias glg='git log --stat --color'
-alias glgp='git log --stat --color -p'
-alias glgg='git log --graph --color'
+alias glg='git log --stat'
+alias glgp='git log --stat -p'
+alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
-alias glo='git log --oneline --decorate --color'
+alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
-alias glog='git log --oneline --decorate --color --graph'
+alias glog='git log --oneline --decorate --graph'
+alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
compdef _git glp=git-log
@@ -220,7 +216,5 @@ alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
-alias gvt='git verify-tag'
-
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"'
diff --git a/plugins/github/README.md b/plugins/github/README.md
index 21b7367f7..fea607876 100644
--- a/plugins/github/README.md
+++ b/plugins/github/README.md
@@ -1,6 +1,6 @@
# github
-This plugin supports working with GitHub the command line. It provides a few things:
+This plugin supports working with GitHub from the command line. It provides a few things:
* Sets up the `hub` wrapper and completions for the `git` command if you have `hub` installed.
* Completion for the `github` Ruby gem.
@@ -37,7 +37,7 @@ See `man hub` for more details.
### Homebrew installation note
-If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
+If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
```zsh
if (( ! ${fpath[(I)/usr/local/share/zsh/site-functions]} )); then
diff --git a/plugins/github/_hub b/plugins/github/_hub
new file mode 100644
index 000000000..3a6493878
--- /dev/null
+++ b/plugins/github/_hub
@@ -0,0 +1,163 @@
+#compdef hub
+
+# Zsh will source this file when attempting to autoload the "_hub" function,
+# typically on the first attempt to complete the hub command. We define two new
+# setup helper routines (one for the zsh-distributed version, one for the
+# git-distributed, bash-based version). Then we redefine the "_hub" function to
+# call "_git" after some other interception.
+#
+# This is pretty fragile, if you think about it. Any number of implementation
+# changes in the "_git" scripts could cause problems down the road. It would be
+# better if the stock git completions were just a bit more permissive about how
+# it allowed third-party commands to be added.
+
+(( $+functions[__hub_setup_zsh_fns] )) ||
+__hub_setup_zsh_fns () {
+ (( $+functions[_git-alias] )) ||
+ _git-alias () {
+ _arguments \
+ '-s[output shell script suitable for eval]' \
+ '1::shell:(zsh bash csh)'
+ }
+
+ (( $+functions[_git-browse] )) ||
+ _git-browse () {
+ _arguments \
+ '-u[output the URL]' \
+ '2::subpage:(wiki commits issues)'
+ }
+
+ (( $+functions[_git-compare] )) ||
+ _git-compare () {
+ _arguments \
+ '-u[output the URL]' \
+ ':[start...]end range:'
+ }
+
+ (( $+functions[_git-create] )) ||
+ _git-create () {
+ _arguments \
+ '::name (REPOSITORY or ORGANIZATION/REPOSITORY):' \
+ '-p[make repository private]' \
+ '-d[description]:description' \
+ '-h[home page]:repository home page URL:_urls'
+ }
+
+ (( $+functions[_git-fork] )) ||
+ _git-fork () {
+ _arguments \
+ '--no-remote[do not add a remote for the new fork]'
+ }
+
+ (( $+functions[_git-pull-request] )) ||
+ _git-pull-request () {
+ _arguments \
+ '-f[force (skip check for local commits)]' \
+ '-b[base]:base ("branch", "owner\:branch", "owner/repo\:branch"):' \
+ '-h[head]:head ("branch", "owner\:branch", "owner/repo\:branch"):' \
+ - set1 \
+ '-m[message]' \
+ '-F[file]' \
+ '-a[user]' \
+ '-M[milestone]' \
+ '-l[labels]' \
+ - set2 \
+ '-i[issue]:issue number:' \
+ - set3 \
+ '::issue-url:_urls'
+ }
+
+ # stash the "real" command for later
+ functions[_hub_orig_git_commands]=$functions[_git_commands]
+
+ # Replace it with our own wrapper.
+ declare -f _git_commands >& /dev/null && unfunction _git_commands
+ _git_commands () {
+ local ret=1
+ # call the original routine
+ _call_function ret _hub_orig_git_commands
+
+ # Effectively "append" our hub commands to the behavior of the original
+ # _git_commands function. Using this wrapper function approach ensures
+ # that we only offer the user the hub subcommands when the user is
+ # actually trying to complete subcommands.
+ hub_commands=(
+ alias:'show shell instructions for wrapping git'
+ pull-request:'open a pull request on GitHub'
+ fork:'fork origin repo on GitHub'
+ create:'create new repo on GitHub for the current project'
+ browse:'browse the project on GitHub'
+ compare:'open GitHub compare view'
+ ci-status:'lookup commit in GitHub Status API'
+ )
+ _describe -t hub-commands 'hub command' hub_commands && ret=0
+
+ return ret
+ }
+}
+
+(( $+functions[__hub_setup_bash_fns] )) ||
+__hub_setup_bash_fns () {
+ # TODO more bash-style fns needed here to complete subcommand args. They take
+ # the form "_git_CMD" where "CMD" is something like "pull-request".
+
+ # Duplicate and rename the 'list_all_commands' function
+ eval "$(declare -f __git_list_all_commands | \
+ sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
+
+ # Wrap the 'list_all_commands' function with extra hub commands
+ __git_list_all_commands() {
+ cat <<-EOF
+alias
+pull-request
+fork
+create
+browse
+compare
+ci-status
+EOF
+ __git_list_all_commands_without_hub
+ }
+
+ # Ensure cached commands are cleared
+ __git_all_commands=""
+}
+
+# redefine _hub to a much smaller function in the steady state
+_hub () {
+ # only attempt to intercept the normal "_git" helper functions once
+ (( $+__hub_func_replacement_done )) ||
+ () {
+ # At this stage in the shell's execution the "_git" function has not yet
+ # been autoloaded, so the "_git_commands" or "__git_list_all_commands"
+ # functions will not be defined. Call it now (with a bogus no-op service
+ # to prevent premature completion) so that we can wrap them.
+ if declare -f _git >& /dev/null ; then
+ _hub_noop () { __hub_zsh_provided=1 } # zsh-provided will call this one
+ __hub_noop_main () { __hub_git_provided=1 } # git-provided will call this one
+ local service=hub_noop
+ _git
+ unfunction _hub_noop
+ unfunction __hub_noop_main
+ service=git
+ fi
+
+ if (( $__hub_zsh_provided )) ; then
+ __hub_setup_zsh_fns
+ elif (( $__hub_git_provided )) ; then
+ __hub_setup_bash_fns
+ fi
+
+ __hub_func_replacement_done=1
+ }
+
+ # Now perform the actual completion, allowing the "_git" function to call our
+ # replacement "_git_commands" function as needed. Both versions expect
+ # service=git or they will call nonexistent routines or end up in an infinite
+ # loop.
+ service=git
+ declare -f _git >& /dev/null && _git
+}
+
+# make sure we actually attempt to complete on the first "tab" from the user
+_hub
diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
index ca19901fd..0ab399c97 100644
--- a/plugins/github/github.plugin.zsh
+++ b/plugins/github/github.plugin.zsh
@@ -71,7 +71,7 @@ exist_gh() { # [DIRECTORY]
#
git.io() {
emulate -L zsh
- curl -i -s http://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "
+ curl -i -s https://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "
}
# End Functions #############################################################
diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh
index 481d487ba..ba1b38711 100644
--- a/plugins/gitignore/gitignore.plugin.zsh
+++ b/plugins/gitignore/gitignore.plugin.zsh
@@ -1,4 +1,4 @@
-function gi() { curl -sL https://www.gitignore.io/api/$@ ;}
+function gi() { curl -sL https://www.gitignore.io/api/${(j:,:)@} }
_gitignoreio_get_command_list() {
curl -sL https://www.gitignore.io/api/list | tr "," "\n"
diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh
index f7eaefa85..2b3105135 100644
--- a/plugins/gulp/gulp.plugin.zsh
+++ b/plugins/gulp/gulp.plugin.zsh
@@ -2,12 +2,12 @@
#
# gulp-autocompletion-zsh
-#
+#
# Autocompletion for your gulp.js tasks
#
# Copyright(c) 2014 André König <andre.koenig@posteo.de>
# MIT Licensed
-#
+#
#
# André König
@@ -20,7 +20,7 @@
# 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)"
+ compls=$(gulp --tasks-simple 2>/dev/null)
completions=(${=compls})
compadd -- $completions
diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh
index 25fd3a2da..7883a65f3 100644
--- a/plugins/history-substring-search/history-substring-search.plugin.zsh
+++ b/plugins/history-substring-search/history-substring-search.plugin.zsh
@@ -13,11 +13,14 @@ fi
# Bind terminal-specific up and down keys
-
+# Bind in both emacs and vi modes so it works in both, and is not
+# sensitive to whether this is loaded before or after the vi-mode plugin
if [[ -n "$terminfo[kcuu1]" ]]; then
- bindkey "$terminfo[kcuu1]" history-substring-search-up
+ bindkey -M emacs "$terminfo[kcuu1]" history-substring-search-up
+ bindkey -M viins "$terminfo[kcuu1]" history-substring-search-up
fi
if [[ -n "$terminfo[kcud1]" ]]; then
- bindkey "$terminfo[kcud1]" history-substring-search-down
+ bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down
+ bindkey -M viins "$terminfo[kcud1]" history-substring-search-down
fi
diff --git a/plugins/history-substring-search/update-from-upstream.zsh b/plugins/history-substring-search/update-from-upstream.zsh
index 6e6cca5d5..81e1942a5 100755
--- a/plugins/history-substring-search/update-from-upstream.zsh
+++ b/plugins/history-substring-search/update-from-upstream.zsh
@@ -76,10 +76,12 @@ cat >> $plugin_basename.plugin.zsh <<EOF
# Bind terminal-specific up and down keys
if [[ -n "\$terminfo[kcuu1]" ]]; then
- bindkey "\$terminfo[kcuu1]" history-substring-search-up
+ bindkey -M emacs "\$terminfo[kcuu1]" history-substring-search-up
+ bindkey -M viins "\$terminfo[kcuu1]" history-substring-search-up
fi
if [[ -n "\$terminfo[kcud1]" ]]; then
- bindkey "\$terminfo[kcud1]" history-substring-search-down
+ bindkey -M emacs "\$terminfo[kcud1]" history-substring-search-down
+ bindkey -M viins "\$terminfo[kcud1]" history-substring-search-down
fi
EOF
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index 341e23ec0..67c989457 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -38,7 +38,11 @@ function jira() {
_jira_query $@
elif [[ "$action" == "dashboard" ]]; then
echo "Opening dashboard"
- open_command "${jira_url}/secure/Dashboard.jspa"
+ if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
+ open_command "${jira_url}/secure/RapidBoard.jspa"
+ else
+ open_command "${jira_url}/secure/Dashboard.jspa"
+ fi
elif [[ "$action" == "dumpconfig" ]]; then
echo "JIRA_URL=$jira_url"
echo "JIRA_PREFIX=$jira_prefix"
@@ -99,4 +103,3 @@ function _jira_query() {
query="${lookup}+%3D+%22${jira_name}%22+AND+resolution+%3D+unresolved+ORDER+BY+priority+DESC%2C+created+ASC"
open_command "${jira_url}/secure/IssueNavigator.jspa?reset=true&jqlQuery=${query}"
}
-
diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
index 86200ccf6..3ae59496e 100644
--- a/plugins/mercurial/mercurial.plugin.zsh
+++ b/plugins/mercurial/mercurial.plugin.zsh
@@ -14,8 +14,7 @@ alias hgo='hg outgoing'
alias hgp='hg push'
alias hgs='hg status'
alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
-# this is the 'git commit --amend' equivalent
-alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
+alias hgca='hg commit --amend'
# list unresolved files (since hg does not list unmerged files in the status command)
alias hgun='hg resolve --list'
diff --git a/plugins/meteor/README.md b/plugins/meteor/README.md
new file mode 100644
index 000000000..4bee87f8f
--- /dev/null
+++ b/plugins/meteor/README.md
@@ -0,0 +1,45 @@
+## Introduction
+
+The [meteor plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/meteor) provides many
+[useful aliases](#aliases) as well as completion for the `meteor` command.
+
+Enable it by adding `meteor` to the plugins array in your zshrc file:
+```zsh
+plugins=(... meteor)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|---------|----------------------------|------------------------------------------------------------------|
+| `ma` | `meteor add` | Add a package to this project |
+| `map` | `meteor add-platform` | Add a platform to this project |
+| `mad` | `meteor admin` | Administrative commands |
+| `mau` | `meteor authorized` | View or change authorized users and organizations for a site |
+| `mb` | `meteor build` | Build this project for all platforms |
+| `mcl` | `meteor claim` | Claim a site deployed with an old Meteor version |
+| `mca` | `meteor configure-android` | Run the Android configuration tool from Meteor's ADK environment |
+| `mc` | `meteor create` | Create a new project |
+| `mdb` | `meteor debug` | Run the project, but suspend the server process for debugging |
+| `mde` | `meteor deploy` | Deploy this project to Meteor |
+| `mis` | `meteor install-sdk` | Installs SDKs for a platform |
+| `ml` | `meteor list` | List the packages explicitly used by your project |
+| `mlp` | `meteor list-platforms` | List the platforms added to your project |
+| `mls` | `meteor list-sites` | List sites for which you are authorized |
+| `mli` | `meteor login` | Log in to your Meteor developer account |
+| `mlo` | `meteor logout` | Log out of your Meteor developer account |
+| `mlog` | `meteor logs` | Show logs for specified site |
+| `mm` | `meteor mongo` | Connect to the Mongo database for the specified site |
+| `mp` | `meteor publish` | Publish a new version of a package to the package server |
+| `mpa` | `meteor publish-for-arch` | Builds an already-published package for a new platform |
+| `mpr` | `meteor publish-release` | Publish a new meteor release to the package server |
+| `mr` | `meteor remove` | Remove a package from this project |
+| `mrp` | `meteor remove-platform` | Remove a platform from this project |
+| `mre` | `meteor reset` | Reset the project state. Erases the local database |
+| `m` | `meteor run` | **[default]** Run this project in local development mode |
+| `ms` | `meteor search` | Search through the package server database |
+| `msh` | `meteor shell` | Launch a Node REPL for interactively evaluating server-side code |
+| `msw` | `meteor show` | Show detailed information about a release or package |
+| `mt` | `meteor test-packages` | Test one or more packages |
+| `mu` | `meteor update` | Upgrade this project's dependencies to their latest versions |
+| `mw` | `meteor whoami` | Prints the username of your Meteor developer account |
diff --git a/plugins/meteor/meteor.plugin.zsh b/plugins/meteor/meteor.plugin.zsh
new file mode 100644
index 000000000..db55e367d
--- /dev/null
+++ b/plugins/meteor/meteor.plugin.zsh
@@ -0,0 +1,33 @@
+# Aliases in alphabetical order
+
+alias ma='meteor add' # Add a package to this project.
+alias map='meteor add-platform' # Add a platform to this project.
+alias mad='meteor admin' # Administrative commands.
+alias mau='meteor authorized' # View or change authorized users and organizations for a site.
+alias mb='meteor build' # Build this project for all platforms.
+alias mcl='meteor claim' # Claim a site deployed with an old Meteor version.
+alias mca='meteor configure-android' # Run the Android configuration tool from Meteor's ADK environment.
+alias mc='meteor create' # Create a new project.
+alias mdb='meteor debug' # Run the project, but suspend the server process for debugging.
+alias mde='meteor deploy' # Deploy this project to Meteor.
+alias mis='meteor install-sdk' # Installs SDKs for a platform.
+alias ml='meteor list' # List the packages explicitly used by your project.
+alias mlp='meteor list-platforms' # List the platforms added to your project.
+alias mls='meteor list-sites' # List sites for which you are authorized.
+alias mli='meteor login' # Log in to your Meteor developer account.
+alias mlo='meteor logout' # Log out of your Meteor developer account.
+alias mlog='meteor logs' # Show logs for specified site.
+alias mm='meteor mongo' # Connect to the Mongo database for the specified site.
+alias mp='meteor publish' # Publish a new version of a package to the package server.
+alias mpa='meteor publish-for-arch' # Builds an already-published package for a new platform.
+alias mpr='meteor publish-release' # Publish a new meteor release to the package server.
+alias mr='meteor remove' # Remove a package from this project.
+alias mrp='meteor remove-platform' # Remove a platform from this project.
+alias mre='meteor reset' # Reset the project state. Erases the local database.
+alias m='meteor run' # [default] Run this project in local development mode.
+alias ms='meteor search' # Search through the package server database.
+alias msh='meteor shell' # Launch a Node REPL for interactively evaluating server-side code.
+alias msw='meteor show' # Show detailed information about a release or package.
+alias mt='meteor test-packages' # Test one or more packages.
+alias mu='meteor update' # Upgrade this project's dependencies to their latest versions.
+alias mw='meteor whoami' # Prints the username of your Meteor developer account.
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index 319932b3f..3b3887b1f 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -73,6 +73,10 @@ case $state in
case $line[1] in
(help)
_arguments ':feature:__task_list'
+ ;;
+ (test)
+ _files
+ ;;
esac
;;
esac
diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md
new file mode 100644
index 000000000..79192bb54
--- /dev/null
+++ b/plugins/mvn/README.md
@@ -0,0 +1,32 @@
+## Introduction
+
+The [mvn plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn) provides many
+[useful aliases](#aliases) as well as completion for the `mvn` command.
+
+Enable it by adding `mvn` to the plugins array in your zshrc file:
+```zsh
+plugins=(... mvn)
+```
+
+## Aliases
+
+| Alias | Command |
+|:---------------------|:------------------------------------------------|
+| `mvncie` | `mvn clean install eclipse:eclipse` |
+| `mvnci` | `mvn clean install` |
+| `mvncist` | `mvn clean install -DskipTests` |
+| `mvne` | `mvn eclipse:eclipse` |
+| `mvnd` | `mvn deploy` |
+| `mvnp` | `mvn package` |
+| `mvnc` | `mvn clean` |
+| `mvncom` | `mvn compile` |
+| `mvnct` | `mvn clean test` |
+| `mvnt` | `mvn test` |
+| `mvnag` | `mvn archetype:generate` |
+| `mvn-updates` | `mvn versions:display-dependency-updates` |
+| `mvntc7` | `mvn tomcat7:run` |
+| `mvnjetty` | `mvn jetty:run` |
+| `mvndt` | `mvn dependency:tree` |
+| `mvns` | `mvn site` |
+| `mvnsrc` | `mvn dependency:sources` |
+| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 865b15235..7aaab0e18 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -1,24 +1,24 @@
# mvn-color based on https://gist.github.com/1027800
-export BOLD=`tput bold`
-export UNDERLINE_ON=`tput smul`
-export UNDERLINE_OFF=`tput rmul`
-export TEXT_BLACK=`tput setaf 0`
-export TEXT_RED=`tput setaf 1`
-export TEXT_GREEN=`tput setaf 2`
-export TEXT_YELLOW=`tput setaf 3`
-export TEXT_BLUE=`tput setaf 4`
-export TEXT_MAGENTA=`tput setaf 5`
-export TEXT_CYAN=`tput setaf 6`
-export TEXT_WHITE=`tput setaf 7`
-export BACKGROUND_BLACK=`tput setab 0`
-export BACKGROUND_RED=`tput setab 1`
-export BACKGROUND_GREEN=`tput setab 2`
-export BACKGROUND_YELLOW=`tput setab 3`
-export BACKGROUND_BLUE=`tput setab 4`
-export BACKGROUND_MAGENTA=`tput setab 5`
-export BACKGROUND_CYAN=`tput setab 6`
-export BACKGROUND_WHITE=`tput setab 7`
-export RESET_FORMATTING=`tput sgr0`
+BOLD=`tput bold`
+UNDERLINE_ON=`tput smul`
+UNDERLINE_OFF=`tput rmul`
+TEXT_BLACK=`tput setaf 0`
+TEXT_RED=`tput setaf 1`
+TEXT_GREEN=`tput setaf 2`
+TEXT_YELLOW=`tput setaf 3`
+TEXT_BLUE=`tput setaf 4`
+TEXT_MAGENTA=`tput setaf 5`
+TEXT_CYAN=`tput setaf 6`
+TEXT_WHITE=`tput setaf 7`
+BACKGROUND_BLACK=`tput setab 0`
+BACKGROUND_RED=`tput setab 1`
+BACKGROUND_GREEN=`tput setab 2`
+BACKGROUND_YELLOW=`tput setab 3`
+BACKGROUND_BLUE=`tput setab 4`
+BACKGROUND_MAGENTA=`tput setab 5`
+BACKGROUND_CYAN=`tput setab 6`
+BACKGROUND_WHITE=`tput setab 7`
+RESET_FORMATTING=`tput sgr0`
# Wrapper function for Maven's mvn command.
@@ -171,7 +171,7 @@ function listMavenCompletions {
gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test
# options
- -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven
+ -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven -Dmaven.test.failure.ignore=true
# arguments
-am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index 3f6fe0fb3..38e699ea0 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -17,3 +17,6 @@ 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"'
+
+# Check which npm modules are outdated
+alias npmO="npm outdated"
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index a1516dcce..c92b6556d 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -46,6 +46,16 @@ EOF
end tell
EOF
+ elif [[ "$the_app" == 'iTerm2' ]]; then
+ osascript <<EOF
+ tell application "iTerm"
+ tell current window
+ create tab with default profile
+ tell current session to write text "${command}"
+ end tell
+ end tell
+EOF
+
else
echo "tab: unsupported terminal app: $the_app"
false
@@ -73,6 +83,19 @@ function vsplit_tab() {
end tell
EOF
+ elif [[ "$the_app" == 'iTerm2' ]]; then
+ osascript <<EOF
+ tell application "iTerm"
+ tell current session of first window
+ set newSession to (split vertically with same profile)
+ tell newSession
+ write text "${command}"
+ select
+ end tell
+ end tell
+ end tell
+EOF
+
else
echo "$0: unsupported terminal app: $the_app" >&2
false
@@ -100,6 +123,19 @@ function split_tab() {
end tell
EOF
+ elif [[ "$the_app" == 'iTerm2' ]]; then
+ osascript <<EOF
+ tell application "iTerm"
+ tell current session of first window
+ set newSession to (split horizontally with same profile)
+ tell newSession
+ write text "${command}"
+ select
+ end tell
+ end tell
+ end tell
+EOF
+
else
echo "$0: unsupported terminal app: $the_app" >&2
false
diff --git a/plugins/pylint/pylint.plugin.zsh b/plugins/pylint/pylint.plugin.zsh
index 6760c67b0..57c7c0ac5 100644
--- a/plugins/pylint/pylint.plugin.zsh
+++ b/plugins/pylint/pylint.plugin.zsh
@@ -1,3 +1,3 @@
# Aliases
-alias pylint-quick='pylint --reports=n --include-ids=y'
-compdef _pylint-quick pylint-quick='pylint --reports=n --include-ids=y' \ No newline at end of file
+alias pylint-quick='pylint --reports=n'
+compdef _pylint-quick pylint-quick='pylint --reports=n'
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index a390c919c..8af1d6301 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -61,6 +61,7 @@ alias rr='rake routes'
alias rrg='rake routes | grep'
alias rt='rake test'
alias rmd='rake middleware'
+alias rsts='rake stats'
# legacy stuff
alias sstat='thin --stats "/thin/stats" start'
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
index 98a2321db..c2a1affad 100644
--- a/plugins/symfony2/symfony2.plugin.zsh
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -22,6 +22,8 @@ alias sf='`_symfony_console`'
alias sfcl='sf cache:clear'
alias sfsr='sf server:run -vvv'
alias sfcw='sf cache:warmup'
-alias sfroute='sf router:debug'
-alias sfcontainer='sf container:debug'
+alias sfroute='sf debug:router'
+alias sfcontainer='sf debug:container'
alias sfgb='sf generate:bundle'
+alias sfdev='sf --env=dev'
+alias sfprod='sf --env=prod'
diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
index 02813de9e..174511019 100644
--- a/plugins/textmate/textmate.plugin.zsh
+++ b/plugins/textmate/textmate.plugin.zsh
@@ -1,13 +1,14 @@
# 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
+# If tm is passed anything else (i.e., a list of files and/or options), pass them all along
+# This allows easy opening of multiple files.
function tm() {
if [[ -z $1 ]]; then
mate .
- else
+ elif [[ -d $1 ]]; then
mate $1
- if [[ -d $1 ]]; then
- cd $1
- fi
+ cd $1
+ else
+ mate "$@"
fi
}
diff --git a/plugins/tmux-cssh/_tmux-cssh b/plugins/tmux-cssh/_tmux-cssh
new file mode 100644
index 000000000..604e2e478
--- /dev/null
+++ b/plugins/tmux-cssh/_tmux-cssh
@@ -0,0 +1,25 @@
+#compdef tmux-cssh
+
+# tmux-cssh autocompletion for oh-my-zsh
+# Requires: tmux-cssh installed
+# Author: Manfred Touron (@moul)
+
+_arguments \
+'(-h --help)'{-h,--help}'[This help.]' \
+'(-u --user)'{-u,--user}'[User to use.]' \
+'(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \
+'(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \
+'(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \
+'(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \
+'(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \
+'(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \
+'(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \
+'(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \
+ ':hosts:_hosts' \
+ '*:: :->subcmds' \
+ && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "tmux-cssh command"
+ return
+fi
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index 764f89545..35377bd9d 100644
--- a/plugins/vagrant/_vagrant
+++ b/plugins/vagrant/_vagrant
@@ -26,6 +26,7 @@ _1st_arguments=(
'rsync:Syncs rsync synced folders to remote machine'
'rsync-auto:Syncs rsync synced folders automatically when files change'
'share:Shares your Vagrant environment with anyone in the world'
+ 'snapshot:Manage snapshots with the guest machine'
'ssh:SSH into the currently running environment'
'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh'
'status:Shows the status of the current Vagrant environment'
diff --git a/plugins/vault/README.md b/plugins/vault/README.md
new file mode 100644
index 000000000..0f61c9410
--- /dev/null
+++ b/plugins/vault/README.md
@@ -0,0 +1,18 @@
+## Vault (https://www.vaultproject.io) autocomplete plugin
+
+- Adds autocomplete options for all vault commands.
+
+####Show help for all commands
+![General Help](http://i.imgur.com/yv5Db1r.png "Help for all commands")
+
+
+####Create new Vault token
+![Create token](http://i.imgur.com/xMegNgh.png "Create token")
+
+
+####Enable audit backends
+![Audit backends](http://i.imgur.com/fKLeiSF.png "Audit backends")
+
+
+
+Crafted with <3 by Valentin Bud ([@valentinbud](https://twitter.com/valentinbud)) \ No newline at end of file
diff --git a/plugins/vault/_vault b/plugins/vault/_vault
new file mode 100644
index 000000000..c5338dffa
--- /dev/null
+++ b/plugins/vault/_vault
@@ -0,0 +1,400 @@
+#compdef vault
+
+typeset -a main_args
+main_args=(
+ '(-version)-version[Prints the Vault version]'
+ '(-help)-help[Prints Vault Help]'
+)
+
+typeset -a general_args
+general_args=(
+ '(-help)-help[Prints Help]'
+ '(-address)-address=-[The address of the Vault server. Overrides the VAULT_ADDR environment variable if set.]:address:'
+ '(-ca-cert)-ca-cert=-[Path to a PEM encoded CA cert file to use to verify the Vault server SSL certificate. Overrides the VAULT_CACERT environment variable if set.]:file:_files -g "*.pem"'
+ '(-ca-path)-ca-path=-[Path to a directory of PEM encoded CA cert files to verify the Vault server SSL certificate. If both -ca-cert and -ca-path are specified, -ca-path is used.Overrides the VAULT_CAPATH environment variable if set.]:directory:_directories'
+ '(-client-cert)-client-cert=-[Path to a PEM encoded client certificate for TLS authentication to the Vault server. Must also specify -client-key. Overrides the VAULT_CLIENT_CERT environment variable if set.]:file:_files -g "*.pem"'
+ '(-client-key)-client-key=-[Path to an unencrypted PEM encoded private key matching the client certificate from -client-cert. Overrides the VAULT_CLIENT_KEY environment variable if set.]:file:_files -g "*.pem"'
+ '(-tls-skip-verify)-tls-skip-verify[Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped if VAULT_SKIP_VERIFY is set.]'
+)
+
+typeset -a audit_enable_args
+audit_enable_args=(
+ '(-description)-description=-[A human-friendly description for the backend. This shows up only when querying the enabled backends.]:description:'
+ '(-id)-id=-[Specify a unique ID for this audit backend. This is purely for referencing this audit backend. By default this will be the backend type.]:id:'
+)
+
+typeset -a auth_args
+auth_args=(
+ '(-method)-method=-[Outputs help for the authentication method with the given name for the remote server. If this authentication method is not available, exit with code 1.]:method:(cert ldap github userpass app-id)'
+ '(-method-help)-method-help[If set, the help for the selected method will be shown.]'
+ '(-methods)-methods[List the available auth methods.]'
+ '(-no-verify)-no-verify[Do not verify the token after creation; avoids a use count]'
+)
+
+typeset -a auth_enable_args
+auth_enable_args=(
+ '(-description)-description=-[Human-friendly description of the purpose for the auth provider. This shows up in the auth-list command.]:description:'
+ '(-path)-path=-[Mount point for the auth provider. This defaults to the type of the mount. This will make the auth provider available at "/auth/<path>"]:path:'
+)
+
+typeset -a init_args
+init_args=(
+ '(-key-shares)-key-shares=-[(default: 5) The number of key shares to split the master key into.]:keyshares:'
+ '(-key-threshold)-key-threshold=-[(default: 3) The number of key shares required to reconstruct the master key.]:keythreshold:'
+ '(-pgp-keys)-pgp-keys[If provided, must be a comma-separated list of files on disk containing binary- or base64-format public PGP keys. The number of files must match "key-shares". The output unseal keys will encrypted and hex-encoded, in order, with the given public keys. If you want to use them with the "vault unseal" command, you will need to hex decode and decrypt; this will be the plaintext unseal key.]:pgpkeys:_files'
+)
+
+typeset -a mount_tune_args
+mount_tune_args=(
+ '(-default-lease-ttl)-default-lease-ttl=-[Default lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:defaultleasettl:'
+ '(-max-lease-ttl)-max-lease-ttl=-[Max lease time-to-live for this backend. If not specified, uses the system default, or the previously set value. Set to "system" to explicitly set it to use the system default.]:maxleasettl:'
+)
+
+typeset -a mount_args
+mount_args=(
+ $mount_tune_args
+ '(-path)-path=-[Mount point for the logical backend. This defauls to the type of the mount.]:path:'
+ '(-description)-description=-[Human-friendly description of the purpose for the mount. This shows up in the mounts command.]:description:'
+)
+
+typeset -a rekey_args
+rekey_args=(
+ $init_args
+ '(-init)-init[Initialize the rekey operation by setting the desired number of shares and the key threshold. This can only be done if no rekey is already initiated.]:init:'
+ '(-cancel)-cancel[Reset the rekey process by throwing away prior keys and the rekey configuration.]:cancel:'
+ '(-status)-status[Prints the status of the current rekey operation. This can be used to see the status without attempting to provide an unseal key.]:status:'
+)
+
+typeset -a ssh_args
+ssh_args=(
+ '(-role)-role[Role to be used to create the key. ]:role:'
+ '(-no-exec)-no-exec[Shows the credentials but does not establish connection.]:noexec:'
+ '(-mount-point)-mount-point[Mount point of SSH backend. If the backend is mounted at "ssh", which is the default as well, this parameter can be skipped.]:mountpoint:'
+ '(-format)-format[If no-exec option is enabled, then the credentials will be printed out and SSH connection will not be established. The format of the output can be "json" or "table". JSON output is useful when writing scripts. Default is "table".]:format:(json table)'
+)
+
+typeset -a token_create_args
+token_create_args=(
+ '(-id)-id=-[The token value that clients will use to authenticate with vault. If not provided this defaults to a 36 character UUID. A root token is required to specify the ID of a token.]:id:'
+ '(-display-name)-display-name=-[A display name to associate with this token. This is a non-security sensitive value used to help identify created secrets, i.e. prefixes.]:displayname:'
+ '(-ttl)-ttl=-[TTL to associate with the token. This option enables the tokens to be renewable.]:ttl:'
+ '*-metadata=-[Metadata to associate with the token. This shows up in the audit log. This can be specified multiple times.]:metadata:'
+ '(-orphan)-orphan[If specified, the token will have no parent. Only root tokens can create orphan tokens. This prevents the new token from being revoked with your token.]:orphan:'
+ '(-no-default-policy)-no-default-policy[If specified, the token will not have the "default" policy included in its policy set.]:nodefaultpolicy:'
+ '*-policy=-[Policy to associate with this token. This can be specified multiple times.]:policy:__vault_policies'
+ '(-use-limit)-use-limit=-[The number of times this token can be used until it is automatically revoked.]:uselimit:'
+ '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)'
+)
+
+typeset -a server_args
+server_args=(
+ '*-config=-[Path to the configuration file or directory. This can be specified multiple times. If it is a directory, all files with a ".hcl" or ".json" suffix will be loaded.]:config:_files'
+ '-dev[Enables Dev mode. In this mode, Vault is completely in-memory and unsealed. Do not run the Dev server in production!]:dev:'
+ '-log-level=-[Log verbosity. Defaults to "info", will be outputtedto stderr. Supported values: "trace", "debug", "info", "warn", "err"]:loglevel:(trace debug info warn err)'
+)
+
+_vault_audit-list() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+_vault_audit-disable() {
+ # vault audit-list doesn't print the backend id so for now
+ # no *smart* autocompletion for this subcommand.
+ _arguments : \
+ ${general_args[@]} \
+ ':::(file syslog)' && ret=0
+}
+
+_vault_audit-enable() {
+ _arguments : \
+ ${general_args[@]} \
+ ${audit_enable_args[@]} \
+ ': :->backends' \
+ '*:: :->backendconfig' && ret=0
+
+ case $state in
+ backends)
+ local -a backends
+ backends=(
+ 'file:The "file" audit backend writes audit logs to a file.'
+ 'syslog:The "syslog" audit backend writes audit logs to syslog.'
+ )
+ _describe -t backends 'vault audit backends' backends && ret=0
+ ;;
+ backendconfig)
+ case ${line[1]} in
+ file)
+ _values -w "Audit Backend File" \
+ 'path[(required) - The path to where the file will be written. If this path exists, the audit backend will append to it.]:file:_files' \
+ 'log_raw[(optional) Should security sensitive information be logged raw. Defaults to "false".]:log_raw:(true false)' && ret=0
+ ;;
+ syslog)
+ _values -w "Audit Backend Syslog" \
+ 'facility[(optional) - The syslog facility to use. Defaults to "AUTH".]:facility:(kern user mail daemon auth syslog lpr news uucp authpriv ftp cron local0 local1 local2 local3 local4 local5 local6 local7)' \
+ 'tag[(optional) - The syslog tag to use. Defaults to "vault".]:tag:' \
+ 'log_raw[(optional) Should security sensitive information be logged raw.]:log_raw:(true false)' && ret=0
+ ;;
+ esac
+ ;;
+ esac
+}
+
+_vault_auth() {
+ _arguments : \
+ ${general_args[@]} \
+ ${auth_args[@]} && ret=0
+}
+
+_vault_auth-enable() {
+ _arguments : \
+ ${general_args[@]} \
+ ${auth_enable_args[@]} \
+ ':::(cert ldap github userpass app-id)' && ret=0
+}
+
+__vault_auth_methods() {
+ local -a authmethods
+ authmethods=($(vault auth -methods | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}'))
+ _describe -t authmethods 'authmethods' authmethods && ret=0
+}
+
+_vault_auth-disable() {
+ _arguments : \
+ ${general_args[@]} \
+ ':::__vault_auth_methods' && ret=0
+
+}
+
+_vault_init() {
+ _arguments : \
+ ${general_args[@]} \
+ ${init_args[@]} && ret=0
+}
+
+_vault_key-status() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+__vault_mounts() {
+ local -a mounts
+ mounts=($(vault mounts | awk 'NR>1{split ($1,a,"/"); print a[1]":["$2"]"}'))
+ _describe -t mounts 'mounts' mounts && ret=0
+}
+
+_vault_mounts() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+_vault_mount() {
+ # to find out how many types of backens are there
+ _arguments : \
+ ${general_args[@]} \
+ ${mount_args[@]} \
+ ':::(generic ssh)' && ret=0
+}
+
+_vault_mount-tune() {
+ _arguments : \
+ ${general_args[@]} \
+ ${mount_tune_args[@]} \
+ ':::__vault_mounts' && ret=0
+}
+
+_vault_unmount() {
+ _arguments : \
+ ${general_args[@]} \
+ ':::__vault_mounts' && ret=0
+}
+
+_vault_remount() {
+ _arguments : \
+ ${general_args[@]} \
+ ':::__vault_mounts' \
+ ':::' && ret=0
+}
+
+__vault_policies() {
+ local -a policies
+ policies=($(vault policies | awk '{print $1":["$1"]"}'))
+ _describe -t policies 'policies' policies && ret=0
+}
+
+_vault_policies() {
+ _arguments : \
+ ${general_args[@]} \
+ ':::__vault_policies' && ret=0
+}
+
+_vault_policy-delete() {
+ _arguments : \
+ ${general_args[@]} \
+ ':::__vault_policies' && ret=0
+}
+
+_vault_policy-write() {
+ _arguments : \
+ ${general_args[@]} \
+ ': ::' \
+ '::policy:_files' && ret=0
+}
+
+_vault_status() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+_vault_rekey() {
+ _arguments : \
+ ${general_args[@]} \
+ ${rekey_args[@]} \
+ ': ::' && ret=0
+}
+
+_vault_rotate() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+_vault_seal() {
+ _arguments : \
+ ${general_args[@]} && ret=0
+}
+
+_vault_ssh() {
+ _arguments : \
+ ${general_args[@]} \
+ ${ssh_args[@]} \
+ ': ::' && ret=0
+}
+
+_vault_token-create() {
+ _arguments : \
+ ${general_args[@]} \
+ ${token_create_args[@]} && ret=0
+}
+
+_vault_token-renew() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
+ ': ::' \
+ ': ::' && ret=0
+}
+
+_vault_token-revoke() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-mode)-mode=-[The type of revocation to do. See the documentation above for more information.]:mode:( orphan path)' \
+ ': ::' && ret=0
+}
+
+_vault_unseal() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-reset)-reset[Reset the unsealing process by throwing away prior keys in process to unseal the vault.]:reset:' \
+ ': ::' && ret=0
+}
+
+_vault_version() {
+ # no args
+}
+
+_vault_delete() {
+ _arguments : \
+ ${general_args[@]} \
+ ': ::' && ret=0
+}
+
+_vault_path-help() {
+ _arguments : \
+ ${general_args[@]} \
+ ': ::' && ret=0
+}
+
+_vault_revoke() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
+ ': ::' \
+ ': ::' && ret=0
+}
+
+_vault_server() {
+ _arguments : \
+ ${server_args[@]} && ret=0
+
+}
+
+_vault_write() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-f -force)'{-f,-force}'[Force the write to continue without any data values specified. This allows writing to keys that do not need or expect any fields to be specified.]:force:' \
+ ': ::' \
+ ': ::' && ret=0
+}
+
+_vault_read() {
+ _arguments : \
+ ${general_args[@]} \
+ '(-format)-format=-[The format for output. By default it is a whitespace-delimited table. This can also be json.]:format:(json table)' \
+ '(-field)-field=-[If included, the raw value of the specified field will be output raw to stdout.]:field:' \
+ ': ::' && ret=0
+}
+
+_vault_commands() {
+ local -a commands
+
+ commands=(
+ "delete":"Delete operation on secrets in Vault"
+ "path-help":"Look up the help for a path"
+ "read":"Read data or secrets from Vault"
+ "renew":"Renew the lease of a secret"
+ "revoke":"Revoke a secret"
+ "server":"Start a Vault server"
+ "status":"Outputs status of whether Vault is sealed and if HA mode is enabled"
+ "write":"Write secrets or configuration into Vault"
+ "audit-disable":"Disable an audit backend"
+ "audit-enable":"Enable an audit backend"
+ "audit-list":"Lists enabled audit backends in Vault"
+ "auth":"Prints information about how to authenticate with Vault"
+ "auth-disable":"Disable an auth provider"
+ "auth-enable":"Enable a new auth provider"
+ "init":"Initialize a new Vault server"
+ "key-status":"Provides information about the active encryption key"
+ "mount":"Mount a logical backend"
+ "mount-tune":"Tune mount configuration parameters"
+ "mounts":"Lists mounted backends in Vault"
+ "policies":"List the policies on the server"
+ "policy-delete":"Delete a policy from the server"
+ "policy-write":"Write a policy to the server"
+ "rekey":"Rekeys Vault to generate new unseal keys"
+ "remount":"Remount a secret backend to a new path"
+ "rotate":"Rotates the backend encryption key used to persist data"
+ "seal":"Seals the vault server"
+ "ssh":"Initiate a SSH session"
+ "token-create":"Create a new auth token"
+ "token-renew":"Renew an auth token if there is an associated lease"
+ "token-revoke":"Revoke one or more auth tokens"
+ "unmount":"Unmount a secret backend"
+ "unseal":"Unseals the vault server"
+ "version":"Prints the Vault version"
+ )
+
+ _describe -t commands 'vault command' commands && ret=0
+}
+
+local curcontext=$curcontext ret=1
+_arguments : \
+ ${main_args[@]} \
+ '*:: :->subcommands' && ret=0
+if ((CURRENT == 1 )); then
+ _vault_commands && ret=0
+fi
+if [[ $state == subcommands ]]; then
+ # (( CURRENT -- ))
+ curcontext="${curcontext%:*:*}:vault-$words[1]:"
+ _call_function ret _vault_$words[1]
+fi
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 369a0e680..d3bf97d75 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -13,6 +13,7 @@ function web_search() {
yandex "https://yandex.ru/yandsearch?text="
github "https://github.com/search?q="
baidu "https://www.baidu.com/s?wd="
+ ecosia "https://www.ecosia.org/search?q="
)
# check whether the search engine is supported
@@ -43,6 +44,7 @@ alias ddg='web_search duckduckgo'
alias yandex='web_search yandex'
alias github='web_search github'
alias baidu='web_search baidu'
+alias ecosia='web_search ecosia'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
diff --git a/plugins/wp-cli/README.md b/plugins/wp-cli/README.md
index 1a79d60fc..da398ed1a 100644
--- a/plugins/wp-cli/README.md
+++ b/plugins/wp-cli/README.md
@@ -4,7 +4,9 @@
WordPress Command Line Interface (http://wp-cli.org/)
-WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser.
+WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser.
+
+This plugin adds [tab completion](http://wp-cli.org/#complete) for `wp-cli` as well as several aliases.
## List of Aliases
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index a6bb9c64a..103041eef 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -43,7 +43,8 @@ CURRENT_BG='NONE'
# This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of
# what font the user is viewing this source code in. Do not replace the
# escape sequence with a single literal character.
- SEGMENT_SEPARATOR=$'\ue0b0' # 
+ # Do not change this! Do not make it '\u2b80'; that is the old, wrong code point.
+ SEGMENT_SEPARATOR=$'\ue0b0'
}
# Begin a segment
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 65466b82f..4f0dcbcc6 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -2,16 +2,25 @@
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
-▶ '
+%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
-PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
+PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
-local _current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
-local _return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
+local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
+local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
+function _current_dir() {
+ local _max_pwd_length="65"
+ if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
+ echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
+ else
+ echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
+ fi
+}
+
function _user_host() {
if [[ -n $SSH_CONNECTION ]]; then
me="%n@%m"
@@ -32,6 +41,8 @@ function _vi_status() {
function _ruby_version() {
if {echo $fpath | grep -q "plugins/rvm"}; then
echo "%{$fg[grey]%}$(rvm_prompt_info)%{$reset_color%}"
+ elif {echo $fpath | grep -q "plugins/rbenv"}; then
+ echo "%{$fg[grey]%}$(rbenv_prompt_info)%{$reset_color%}"
fi
}
@@ -85,13 +96,13 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ "
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ "
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ "
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
-ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}"
+ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}"
# LS colors, made with http://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxegedabagacad"
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index 215720477..1ead93553 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -1,7 +1,13 @@
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
-local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+
+if [[ $UID -eq 0 ]]; then
+ local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
+else
+ local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
+fi
+
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local rvm_ruby=''
if which rvm-prompt &> /dev/null; then
diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme
index 148abec10..3b3bdc80f 100644
--- a/themes/bureau.zsh-theme
+++ b/themes/bureau.zsh-theme
@@ -22,34 +22,44 @@ bureau_git_branch () {
echo "${ref#refs/heads/}"
}
-bureau_git_status () {
- _INDEX=$(command git status --porcelain -b 2> /dev/null)
+bureau_git_status() {
_STATUS=""
- if $(echo "$_INDEX" | grep '^[AMRD]. ' &> /dev/null); then
- _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
- fi
- if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then
- _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
- fi
- if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then
- _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
- fi
- if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then
- _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
- fi
- if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
- _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED"
+
+ # check status of files
+ _INDEX=$(command git status --porcelain 2> /dev/null)
+ if [[ -n "$_INDEX" ]]; then
+ if $(echo "$_INDEX" | command grep -q '^[AMRD]. '); then
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
+ fi
+ if $(echo "$_INDEX" | command grep -q '^.[MTD] '); then
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
+ fi
+ if $(echo "$_INDEX" | command grep -q -E '^\?\? '); then
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
+ fi
+ if $(echo "$_INDEX" | command grep -q '^UU '); then
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
+ fi
+ else
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
- if $(echo "$_INDEX" | grep '^## .*ahead' &> /dev/null); then
+
+ # check status of local repository
+ _INDEX=$(command git status --porcelain -b 2> /dev/null)
+ if $(echo "$_INDEX" | command grep -q '^## .*ahead'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
- if $(echo "$_INDEX" | grep '^## .*behind' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^## .*behind'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
- if $(echo "$_INDEX" | grep '^## .*diverged' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^## .*diverged'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED"
fi
+ if $(command git rev-parse --verify refs/stash &> /dev/null); then
+ _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED"
+ fi
+
echo $_STATUS
}
@@ -84,10 +94,10 @@ _LIBERTY="$_LIBERTY%{$reset_color%}"
get_space () {
local STR=$1$2
local zero='%([BSUbfksu]|([FB]|){*})'
- local LENGTH=${#${(S%%)STR//$~zero/}}
+ local LENGTH=${#${(S%%)STR//$~zero/}}
local SPACES=""
(( LENGTH = ${COLUMNS} - $LENGTH - 1))
-
+
for i in {0..$LENGTH}
do
SPACES="$SPACES "
@@ -101,7 +111,7 @@ _1RIGHT="[%*] "
bureau_precmd () {
_1SPACES=`get_space $_1LEFT $_1RIGHT`
- print
+ print
print -rP "$_1LEFT$_1SPACES$_1RIGHT"
}
diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme
index bc125c5ce..40e6d411e 100644
--- a/themes/candy.zsh-theme
+++ b/themes/candy.zsh-theme
@@ -1,4 +1,4 @@
-PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
+PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%X]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme
index 1b284cdc2..88134f8e6 100644
--- a/themes/eastwood.zsh-theme
+++ b/themes/eastwood.zsh-theme
@@ -14,9 +14,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
- local cb=$(current_branch)
+ local cb=$(git_current_branch)
if [ -n "$cb" ]; then
- echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
index 8b24172a2..83bd455b5 100644
--- a/themes/fishy.zsh-theme
+++ b/themes/fishy.zsh-theme
@@ -1,13 +1,13 @@
# ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() {
- echo $(pwd | perl -pe "
+ echo $(pwd | perl -pe '
BEGIN {
- binmode STDIN, ':encoding(UTF-8)';
- binmode STDOUT, ':encoding(UTF-8)';
- }; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g
-")
-}
+ binmode STDIN, ":encoding(UTF-8)";
+ binmode STDOUT, ":encoding(UTF-8)";
+ }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
+')
+}
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
diff --git a/themes/frontcube.zsh-theme b/themes/frontcube.zsh-theme
index d9f5b6d9c..539e744f8 100644
--- a/themes/frontcube.zsh-theme
+++ b/themes/frontcube.zsh-theme
@@ -4,7 +4,7 @@ PROMPT='
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%}
%{$fg[green]%}➞ %{$reset_color%'
-RPROMPT='$(git_prompt_info) $(rvm)'
+RPROMPT='$(git_prompt_info) ${rvm}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
index d383ed583..515325e38 100644
--- a/themes/gallois.zsh-theme
+++ b/themes/gallois.zsh-theme
@@ -1,3 +1,5 @@
+# Depends on the git plugin for work_in_progress()
+
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
@@ -5,9 +7,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
- local cb=$(current_branch)
+ local cb=$(git_current_branch)
if [ -n "$cb" ]; then
- echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
index 12dfe4069..c8f0f4dd7 100644
--- a/themes/josh.zsh-theme
+++ b/themes/josh.zsh-theme
@@ -9,7 +9,7 @@ function josh_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
- branch=$(current_branch)
+ branch=$(git_current_branch)
ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
path_size=${#PWD}
branch_size=${#branch}
@@ -31,7 +31,7 @@ function josh_prompt {
prompt=" $prompt"
done
- prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(current_branch)"
+ prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_current_branch)"
echo $prompt
}
diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme
index bc470e838..dbdfde7b8 100644
--- a/themes/juanghurtado.zsh-theme
+++ b/themes/juanghurtado.zsh-theme
@@ -1,5 +1,3 @@
-# Needs Git plugin for current_branch method
-
# Color shortcuts
RED=$fg[red]
YELLOW=$fg[yellow]
@@ -40,4 +38,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"
PROMPT='
%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%}
%{$BLUE%}>%{$RESET_COLOR%} '
-RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
+RPROMPT='%{$GREEN_BOLD%}$(git_current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
diff --git a/themes/kennethreitz.zsh-theme b/themes/kennethreitz.zsh-theme
index 109be0c22..b255a8d66 100644
--- a/themes/kennethreitz.zsh-theme
+++ b/themes/kennethreitz.zsh-theme
@@ -1,13 +1,15 @@
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
-PROMPT='%{$fg[green]%}%c \
+PROMPT='$(virtualenv_prompt_info)%{%}%{$fg[green]%}%c \
$(git_prompt_info)\
+\
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
-ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}("
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}"
-
+ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="%{$reset_color%}%{%}%{$fg[blue]%}"
+ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="!%{$reset_color%} " \ No newline at end of file
diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme
index ccce4197a..55ece9760 100644
--- a/themes/mortalscumbag.zsh-theme
+++ b/themes/mortalscumbag.zsh-theme
@@ -5,7 +5,7 @@ function my_git_prompt() {
STATUS=""
# is branch ahead?
- if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
@@ -37,7 +37,7 @@ function my_git_prompt() {
}
function my_current_branch() {
- echo $(current_branch || echo "(no branch)")
+ echo $(git_current_branch || echo "(no branch)")
}
function ssh_connection() {
diff --git a/themes/peepcode.zsh-theme b/themes/peepcode.zsh-theme
index ca2a8862f..96e4f1192 100644
--- a/themes/peepcode.zsh-theme
+++ b/themes/peepcode.zsh-theme
@@ -28,7 +28,7 @@ git_dirty() {
}
git_prompt() {
- local cb=$(current_branch)
+ local cb=$(git_current_branch)
if [ -n "$cb" ]; then
local repo_path=$(git_repo_path)
echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)"
diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme
index 24e1e8c52..f9eca6a87 100644
--- a/themes/robbyrussell.zsh-theme
+++ b/themes/robbyrussell.zsh-theme
@@ -1,7 +1,7 @@
-local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
-PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
+PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
-ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme
index 28befd01b..e3f4019d6 100644
--- a/themes/sunrise.zsh-theme
+++ b/themes/sunrise.zsh-theme
@@ -1,6 +1,5 @@
# Sunrise theme for oh-my-zsh
# Intended to be used with Solarized: http://ethanschoonover.com/solarized
-# (Needs Git plugin for current_branch method)
# Color shortcuts
R=$fg_no_bold[red]
@@ -11,9 +10,9 @@ B=$fg_no_bold[blue]
RESET=$reset_color
if [ "$USER" = "root" ]; then
- PROMPTCOLOR="%{$R%}" PREFIX="-!-";
+ PROMPTCOLOR="%{$R%}" PROMPTPREFIX="-!-";
else
- PROMPTCOLOR="" PREFIX="---";
+ PROMPTCOLOR="" PROMPTPREFIX="---";
fi
local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
@@ -67,7 +66,7 @@ function custom_git_prompt() {
}
# %B sets bold text
-PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
+PROMPT='%B$PROMPTPREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$Y%}‹"
diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme
index fd8adc41e..89d5355dc 100644
--- a/themes/ys.zsh-theme
+++ b/themes/ys.zsh-theme
@@ -1,18 +1,9 @@
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
-# It is recommended to use with a dark background and the font Inconsolata.
+# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
-#
-# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
-# Mar 2013 ys
-
-# Machine name.
-function box_name {
- [ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
-}
-
-# Directory info.
-local current_dir='${PWD/#$HOME/~}'
+#
+# Mar 2013 Yad Smood
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
@@ -21,7 +12,7 @@ YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
-# Git info.
+# Git info
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
@@ -44,29 +35,26 @@ ys_hg_prompt_info() {
fi
}
-# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
-PROMPT="
-%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
-%{$fg[cyan]%}%n \
-%{$fg[white]%}at \
-%{$fg[green]%}$(box_name) \
-%{$fg[white]%}in \
-%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
-${hg_info}\
-${git_info} \
-%{$fg[white]%}[%*]
-%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
+local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"
-if [[ "$USER" == "root" ]]; then
+# Prompt format:
+#
+# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE
+# $ COMMAND
+#
+# For example:
+#
+# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0
+# $
PROMPT="
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
-%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \
-%{$fg[white]%}at \
-%{$fg[green]%}$(box_name) \
+%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$fg[cyan]%}%n) \
+%{$fg[white]%}@ \
+%{$fg[green]%}%m \
%{$fg[white]%}in \
-%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
+%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
${hg_info}\
-${git_info} \
-%{$fg[white]%}[%*]
+${git_info}\
+ \
+%{$fg[white]%}[%*] $exit_code
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
-fi
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index fe8fbadca..d5e7e8ba8 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -20,7 +20,7 @@ else
NORMAL=""
fi
-printf "${BLUE}%s${NORMAL}\n" "Upgrading Oh My Zsh"
+printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh"
cd "$ZSH"
if git pull --rebase --stat origin master
then