summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/adb/README.md8
-rw-r--r--plugins/adb/_adb39
-rw-r--r--plugins/ant/ant.plugin.zsh6
-rw-r--r--plugins/archlinux/archlinux.plugin.zsh18
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh11
-rw-r--r--plugins/autojump/autojump.plugin.zsh10
-rw-r--r--plugins/aws/aws.plugin.zsh22
-rw-r--r--plugins/battery/battery.plugin.zsh2
-rw-r--r--plugins/bbedit/README.md20
-rw-r--r--plugins/bbedit/bbedit.plugin.zsh21
-rw-r--r--[-rwxr-xr-x]plugins/bower/_bower0
-rw-r--r--plugins/brew/_brew39
-rw-r--r--plugins/brew/brew.plugin.zsh1
-rw-r--r--plugins/bundler/README.md49
-rw-r--r--plugins/bundler/_bundler13
-rw-r--r--plugins/bundler/bundler.plugin.zsh62
-rw-r--r--plugins/cabal/cabal.plugin.zsh52
-rw-r--r--plugins/cake/cake.plugin.zsh2
-rw-r--r--plugins/chruby/chruby.plugin.zsh6
-rw-r--r--plugins/chucknorris/.gitignore1
-rw-r--r--plugins/chucknorris/LICENSE2
-rw-r--r--plugins/chucknorris/chucknorris.plugin.zsh6
-rw-r--r--plugins/chucknorris/fortunes/chucknorris904
-rw-r--r--plugins/colemak/colemak.plugin.zsh2
-rw-r--r--plugins/colored-man/colored-man.plugin.zsh21
-rw-r--r--plugins/colorize/colorize.plugin.zsh10
-rw-r--r--plugins/command-not-found/command-not-found.plugin.zsh16
-rw-r--r--plugins/common-aliases/common-aliases.plugin.zsh10
-rw-r--r--plugins/composer/composer.plugin.zsh32
-rw-r--r--plugins/dircycle/dircycle.plugin.zsh41
-rw-r--r--plugins/dirhistory/dirhistory.plugin.zsh6
-rw-r--r--plugins/django/django.plugin.zsh3
-rw-r--r--plugins/docker/_docker23
-rw-r--r--plugins/ember-cli/README.md22
-rw-r--r--plugins/ember-cli/ember-cli.plugin.zsh19
-rw-r--r--plugins/emoji-clock/emoji-clock.plugin.zsh28
-rw-r--r--plugins/extract/extract.plugin.zsh6
-rw-r--r--plugins/forklift/forklift.plugin.zsh2
-rw-r--r--plugins/frontend-search/README.md82
-rw-r--r--plugins/frontend-search/frontend-search.plugin.zsh151
-rw-r--r--plugins/gem/_gem2
-rw-r--r--plugins/git-flow/git-flow.plugin.zsh4
-rw-r--r--plugins/git-hubflow/git-hubflow.plugin.zsh4
-rw-r--r--plugins/git-prompt/git-prompt.plugin.zsh3
-rw-r--r--plugins/git/git.plugin.zsh21
-rw-r--r--plugins/github/github.plugin.zsh2
-rw-r--r--plugins/gitignore/gitignore.plugin.zsh12
-rw-r--r--plugins/golang/golang.plugin.zsh3
-rw-r--r--plugins/gradle/gradle.plugin.zsh2
-rw-r--r--[-rwxr-xr-x]plugins/grails/grails.plugin.zsh0
-rw-r--r--plugins/grunt/grunt.plugin.zsh253
-rw-r--r--plugins/heroku/_heroku32
-rw-r--r--plugins/history-substring-search/README7
-rw-r--r--plugins/history-substring-search/README.markdown7
-rw-r--r--plugins/jhbuild/README.md4
-rw-r--r--plugins/jhbuild/jhbuild.plugin.zsh28
-rw-r--r--plugins/jira/jira.plugin.zsh55
-rw-r--r--[-rwxr-xr-x]plugins/jruby/jruby.plugin.zsh0
-rw-r--r--plugins/jump/jump.plugin.zsh9
-rw-r--r--plugins/laravel4/laravel4.plugin.zsh2
-rw-r--r--plugins/laravel5/laravel5.plugin.zsh20
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh4
-rw-r--r--plugins/marked2/README.md13
-rw-r--r--plugins/marked2/marked2.plugin.zsh12
-rw-r--r--plugins/mercurial/mercurial.plugin.zsh6
-rw-r--r--plugins/mix/_mix1
-rw-r--r--plugins/mvn/mvn.plugin.zsh13
-rw-r--r--plugins/node/node.plugin.zsh2
-rw-r--r--plugins/npm/npm.plugin.zsh6
-rw-r--r--plugins/osx/osx.plugin.zsh39
-rw-r--r--plugins/pass/_pass33
-rw-r--r--plugins/perl/perl.plugin.zsh8
-rw-r--r--plugins/phing/phing.plugin.zsh4
-rw-r--r--plugins/pip/_pip2
-rw-r--r--plugins/pj/pj.plugin.zsh11
-rw-r--r--plugins/postgres/postgres.plugin.zsh8
-rw-r--r--plugins/pow/pow.plugin.zsh8
-rw-r--r--plugins/profiles/profiles.plugin.zsh2
-rw-r--r--plugins/rails/rails.plugin.zsh4
-rw-r--r--plugins/rake-fast/rake-fast.plugin.zsh2
-rw-r--r--plugins/rbenv/rbenv.plugin.zsh2
-rw-r--r--plugins/repo/repo.plugin.zsh6
-rw-r--r--plugins/rsync/rsync.plugin.zsh8
-rw-r--r--plugins/rvm/rvm.plugin.zsh12
-rw-r--r--plugins/scd/README.md15
-rwxr-xr-xplugins/scd/scd119
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh2
-rw-r--r--[-rwxr-xr-x]plugins/sublime/sublime.plugin.zsh3
-rw-r--r--plugins/sudo/sudo.plugin.zsh5
-rw-r--r--plugins/svn-fast-info/svn-fast-info.plugin.zsh12
-rw-r--r--plugins/svn/svn.plugin.zsh6
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh26
-rw-r--r--plugins/systemadmin/systemadmin.plugin.zsh (renamed from plugins/systemadmin/systemadmin.zsh)2
-rw-r--r--plugins/taskwarrior/_task2
-rw-r--r--plugins/textastic/README.md15
-rw-r--r--plugins/textastic/textastic.plugin.zsh17
-rw-r--r--plugins/tmux/tmux.plugin.zsh2
-rw-r--r--plugins/tmuxinator/_tmuxinator12
-rw-r--r--plugins/ubuntu/readme.md21
-rw-r--r--plugins/ubuntu/ubuntu.plugin.zsh141
-rw-r--r--plugins/vagrant/_vagrant16
-rw-r--r--plugins/vi-mode/vi-mode.plugin.zsh14
-rw-r--r--plugins/vim-interaction/vim-interaction.plugin.zsh2
-rw-r--r--plugins/virtualenv/virtualenv.plugin.zsh5
-rw-r--r--plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh111
-rw-r--r--plugins/vundle/vundle.plugin.zsh2
-rw-r--r--plugins/wd/LICENSE21
-rw-r--r--plugins/wd/README.md142
-rw-r--r--plugins/wd/_wd.sh32
-rw-r--r--[-rwxr-xr-x]plugins/wd/wd.plugin.zsh4
-rwxr-xr-xplugins/wd/wd.sh419
-rw-r--r--plugins/web-search/web-search.plugin.zsh63
-rw-r--r--plugins/wp-cli/README.md105
-rw-r--r--plugins/wp-cli/wp-cli.plugin.zsh160
-rw-r--r--plugins/xcode/xcode.plugin.zsh10
-rw-r--r--plugins/yii2/README.md7
-rw-r--r--plugins/yii2/yii2.plugin.zsh29
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh5
118 files changed, 3478 insertions, 513 deletions
diff --git a/plugins/adb/README.md b/plugins/adb/README.md
new file mode 100644
index 000000000..075beec0e
--- /dev/null
+++ b/plugins/adb/README.md
@@ -0,0 +1,8 @@
+# adb autocomplete plugin
+
+* Adds autocomplete options for all adb commands.
+
+
+## Requirements
+
+In order to make this work, you will need to have the Android adb tools set up in your path.
diff --git a/plugins/adb/_adb b/plugins/adb/_adb
new file mode 100644
index 000000000..4c998172d
--- /dev/null
+++ b/plugins/adb/_adb
@@ -0,0 +1,39 @@
+#compdef adb
+#autoload
+
+# in order to make this work, you will need to have the android adb tools
+
+# adb zsh completion, based on homebrew completion
+
+local -a _1st_arguments
+_1st_arguments=(
+'bugreport:return all information from the device that should be included in a bug report.'
+'connect:connect to a device via TCP/IP Port 5555 is default.'
+'devices:list all connected devices'
+'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
+'emu:run emulator console command'
+'forward:forward socket connections'
+'help:show the help message'
+'install:push this package file to the device and install it'
+'jdwp:list PIDs of processes hosting a JDWP transport'
+'logcat:View device log'
+'pull:copy file/dir from device'
+'push:copy file/dir to device'
+'shell:run remote shell interactively'
+'sync:copy host->device only if changed (-l means list but dont copy)'
+'uninstall:remove this app package from the device'
+'version:show version num'
+)
+
+local expl
+local -a pkgs installed_pkgs
+
+_arguments \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "adb subcommand" _1st_arguments
+ return
+fi
+
+_files
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
index 45f2b06eb..0b738c94f 100644
--- a/plugins/ant/ant.plugin.zsh
+++ b/plugins/ant/ant.plugin.zsh
@@ -1,15 +1,15 @@
_ant_does_target_list_need_generating () {
[ ! -f .ant_targets ] && return 0;
- [ .ant_targets -nt build.xml ] && return 0;
+ [ build.xml -nt .ant_targets ] && return 0;
return 1;
}
_ant () {
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
- sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
fi
- compadd `cat .ant_targets`
+ compadd -- `cat .ant_targets`
fi
}
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index bffe9657a..059884c27 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -21,10 +21,14 @@ if [[ -x `which 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 `which abs` ]]; then
+ if [[ -x `which abs` && -x `which aur` ]]; then
+ alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
+ elif [[ -x `which abs` ]]; then
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
+ elif [[ -x `which 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 and ABS databases against repositories
+ alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
fi
alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package
alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
@@ -45,10 +49,14 @@ 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 `which abs` ]]; then
- alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
+if [[ -x `which abs` && -x `which 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 `which abs` ]]; then
+ alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
+elif [[ -x `which 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 and ABS databases against repositories
+ alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
fi
alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index ca5666979..a8271849e 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,6 +1,17 @@
+# Activates autoenv or reports its failure
+if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
+ echo '-------- AUTOENV ---------'
+ echo 'Could not find ~/.autoenv/activate.sh.'
+ echo 'Please check if autoenv is correctly installed.'
+ echo 'In the meantime the autoenv plugin is DISABLED.'
+ echo '--------------------------'
+ return 1
+fi
+
# The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one.
+
use_env() {
typeset venv
venv="$1"
diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
index 0aa14959d..4cf036401 100644
--- a/plugins/autojump/autojump.plugin.zsh
+++ b/plugins/autojump/autojump.plugin.zsh
@@ -1,5 +1,11 @@
if [ $commands[autojump] ]; then # check if autojump is installed
- if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
+ if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
+ . $HOME/.autojump/etc/profile.d/autojump.zsh
+ elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation
+ . $HOME/.autojump/share/autojump/autojump.zsh
+ elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation
+ . $HOME/.nix-profile/etc/profile.d/autojump.zsh
+ elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
@@ -7,8 +13,6 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /etc/profile.d/autojump.sh
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
. /usr/local/share/autojump/autojump.zsh
- elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
- . $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 3f7fb1995..0ae18dd56 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -1,17 +1,31 @@
+_homebrew-installed() {
+ type brew &> /dev/null
+}
+
+_awscli-homebrew-installed() {
+ brew list awscli &> /dev/null
+}
+
export AWS_HOME=~/.aws
function agp {
echo $AWS_DEFAULT_PROFILE
-
}
function asp {
export AWS_DEFAULT_PROFILE=$1
- export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
-
+ export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
}
function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
}
compctl -K aws_profiles asp
-source `which aws_zsh_completer.sh`
+
+if _homebrew-installed && _awscli-homebrew-installed ; then
+ _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
+else
+ _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
+fi
+
+[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
+unset _aws_zsh_completer_path
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 32dd4b624..014bb15dd 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -8,7 +8,7 @@
# Modified to add support for Apple Mac #
###########################################
-if [[ $(uname) == "Darwin" ]] ; then
+if [[ "$OSTYPE" = darwin* ]] ; then
function battery_pct() {
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md
new file mode 100644
index 000000000..ec2b743d6
--- /dev/null
+++ b/plugins/bbedit/README.md
@@ -0,0 +1,20 @@
+## bbedit
+
+Plugin for BBEdit, an HTML and text editor for Mac OS X
+
+### Requirements
+
+ * [BBEdit](http://www.barebones.com/products/bbedit/)
+ * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
+
+### Usage
+
+ * If the `bb` command is called without an argument, launch BBEdit
+
+ * If `bb` is passed a directory, cd to it and open it in BBEdit
+
+ * If `bb` is passed a file, open it in BBEdit
+
+ * If `bbpb` create a new BBEdit document with the contents of the clipboard
+
+ * If `bbd` alias for BBEdit diff tool
diff --git a/plugins/bbedit/bbedit.plugin.zsh b/plugins/bbedit/bbedit.plugin.zsh
new file mode 100644
index 000000000..fe9e72c65
--- /dev/null
+++ b/plugins/bbedit/bbedit.plugin.zsh
@@ -0,0 +1,21 @@
+alias bbpb='pbpaste | bbedit --clean --view-top'
+
+alias bbd=bbdiff
+
+#
+# If the bb command is called without an argument, launch BBEdit
+# If bb is passed a directory, cd to it and open it in BBEdit
+# If bb is passed a file, open it in BBEdit
+#
+function bb() {
+ if [[ -z "$1" ]]
+ then
+ bbedit --launch
+ else
+ bbedit "$1"
+ if [[ -d "$1" ]]
+ then
+ cd "$1"
+ fi
+ fi
+}
diff --git a/plugins/bower/_bower b/plugins/bower/_bower
index ae0ca4a4e..ae0ca4a4e 100755..100644
--- a/plugins/bower/_bower
+++ b/plugins/bower/_bower
diff --git a/plugins/brew/_brew b/plugins/brew/_brew
index 9eb3bb557..d11aa245d 100644
--- a/plugins/brew/_brew
+++ b/plugins/brew/_brew
@@ -19,21 +19,18 @@ _brew_outdated_formulae() {
outdated_formulae=(`brew outdated`)
}
-_brew_running_services() {
- running_services=(`brew services list | awk '{print $1}'`)
-}
-
local -a _1st_arguments
_1st_arguments=(
'audit:check formulae for Homebrew coding style'
- 'bundle:look for a Brewfile and run each line as a brew command'
'cat:display formula file for a formula'
'cleanup:uninstall unused and old versions of packages'
'commands:show a list of commands'
'create:create a new formula'
- 'deps:list dependencies and dependants of a formula'
+ 'deps:list dependencies of a formula'
'doctor:audits your installation for common issues'
'edit:edit a formula'
+ 'fetch:download formula resources to the cache'
+ 'gist-logs:generate a gist of the full build logs'
'home:visit the homepage of a formula or the brew project'
'info:information about a formula'
'install:install a formula'
@@ -44,31 +41,24 @@ _1st_arguments=(
'missing:check all installed formuale for missing dependencies.'
'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)'
- 'server:start a local web app that lets you browse formulae (requires Sinatra)'
- 'services:small wrapper around `launchctl` for supported formulae'
+ 'switch:switch linkage between installed versions of a formula'
'tap:tap a new formula repository from GitHub, or list existing taps'
+ 'test-bot:test a formula and build a bottle'
+ 'uninstall:uninstall a formula'
'unlink:unlink a formula'
'unpin:unpin specified formulae'
'untap:remove a tapped repository'
- 'update:freshen up links'
+ 'update:pull latest repository'
'upgrade:upgrade outdated formulae'
'uses:show formulae which depend on a formula'
)
-local -a _service_arguments
-_service_arguments=(
- 'cleanup:get rid of stale services and unused plists'
- 'list:list all services managed by `brew services`'
- 'restart:gracefully restart selected service'
- 'start:start selected service'
- 'stop:stop selected service'
-)
-
local expl
-local -a formulae installed_formulae installed_taps outdated_formulae running_services
+local -a formulae installed_formulae installed_taps outdated_formulae
_arguments \
'(-v)-v[verbose]' \
@@ -79,6 +69,7 @@ _arguments \
'(--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
@@ -108,16 +99,6 @@ case "$words[1]" in
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
- services)
- if [[ -n "$words[2]" ]]; then
- case "$words[2]" in
- restart|start|stop)
- _brew_running_services
- _wanted running_services expl 'running services' compadd -a running_services ;;
- esac
- else
- _describe -t commands "brew services subcommand" _service_arguments
- fi ;;
untap)
_brew_installed_taps
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index c2e95884e..42fb80c9a 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -1 +1,2 @@
alias brews='brew list -1'
+alias bubu="brew update && brew upgrade && brew cleanup"
diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
new file mode 100644
index 000000000..56f0c7176
--- /dev/null
+++ b/plugins/bundler/README.md
@@ -0,0 +1,49 @@
+# Bundler
+
+- adds completion for basic bundler commands
+- adds short aliases for common bundler commands
+ - `be` aliased to `bundle exec`
+ - `bl` aliased to `bundle list`
+ - `bp` aliased to `bundle package`
+ - `bo` aliased to `bundle open`
+ - `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:
+ - looks for a binstub under `./bin/` and executes it (if present)
+ - calls `bundle exec <gem executable>` otherwise
+
+For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
+
+## Configuration
+
+Please use the exact name of the executable and not the gem name.
+
+### Add additional gems to be wrapped
+
+Add this before the plugin-list in your `.zshrc`:
+```sh
+BUNDLED_COMMANDS=(rubocop)
+plugins=(... bundler ...)
+```
+This will add the wrapper for the `rubocop` gem (i.e. the executable).
+
+
+### Exclude gems from being wrapped
+
+Add this before the plugin-list in your `.zshrc`:
+```sh
+UNBUNDLED_COMMANDS=(foreman spin)
+plugins=(... bundler ...)
+```
+This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
+
+## Excluded gems
+
+These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification.
+
+`berks`
+`foreman`
+`mailcatcher`
+`rails`
+`ruby`
+`spin`
diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
index 2ec3a5f9c..ba647ab80 100644
--- a/plugins/bundler/_bundler
+++ b/plugins/bundler/_bundler
@@ -18,11 +18,13 @@ case $state in
"check[Determine whether the requirements for your application are installed]" \
"list[Show all of the gems in the current bundle]" \
"show[Show the source location of a particular gem in the bundle]" \
+ "outdated[Show all of the outdated gems in the current bundle]" \
"console[Start an IRB session in the context of the current bundle]" \
"open[Open an installed gem in the editor]" \
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
+ "platform[Displays platform compatibility information]" \
"clean[Cleans up unused gems in your bundler directory]" \
"help[Describe available tasks or one specific task]"
ret=0
@@ -39,11 +41,13 @@ case $state in
'check' \
'list' \
'show' \
+ 'outdated' \
'console' \
'open' \
'viz' \
'init' \
'gem' \
+ 'platform' \
'help' && ret=0
;;
install)
@@ -71,6 +75,15 @@ case $state in
'(--verbose)--verbose[Enable verbose output mode]'
ret=0
;;
+ outdated)
+ _arguments \
+ '(--pre)--pre[Check for newer pre-release gems]' \
+ '(--source)--source[Check against a specific source]' \
+ '(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \
+ '(--no-color)--no-color[Disable colorization in output]' \
+ '(--verbose)--verbose[Enable verbose output mode]'
+ ret=0
+ ;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 3338d78be..ba3d3f623 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -3,23 +3,58 @@ alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
alias bu="bundle update"
+alias bi="bundle_install"
-# The following is based on https://github.com/gma/bundler-exec
-
-bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails)
+bundled_commands=(
+ annotate
+ cap
+ capify
+ cucumber
+ foodcritic
+ guard
+ irb
+ jekyll
+ kitchen
+ knife
+ middleman
+ nanoc
+ pry
+ puma
+ rackup
+ rainbows
+ rake
+ rspec
+ shotgun
+ sidekiq
+ spec
+ spork
+ spring
+ strainer
+ tailor
+ taps
+ thin
+ thor
+ unicorn
+ unicorn_rails
+)
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do
bundled_commands=(${bundled_commands#$cmd});
done
+# Add $BUNDLED_COMMANDS to the bundled_commands list
+for cmd in $BUNDLED_COMMANDS; do
+ bundled_commands+=($cmd);
+done
+
## Functions
-bi() {
+bundle_install() {
if _bundler-installed && _within-bundled-project; then
local bundler_version=`bundle version | cut -d' ' -f3`
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
- if [[ "$(uname)" == 'Darwin' ]]
+ if [[ "$OSTYPE" = darwin* ]]
then
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
else
@@ -39,17 +74,25 @@ _bundler-installed() {
}
_within-bundled-project() {
- local check_dir=$PWD
- while [ $check_dir != "/" ]; do
+ local check_dir="$PWD"
+ while [ "$check_dir" != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)"
done
false
}
+_binstubbed() {
+ [ -f "./bin/${1}" ]
+}
+
_run-with-bundler() {
if _bundler-installed && _within-bundled-project; then
- bundle exec $@
+ if _binstubbed $1; then
+ ./bin/$@
+ else
+ bundle exec $@
+ fi
else
$@
fi
@@ -62,7 +105,6 @@ for cmd in $bundled_commands; do
alias $cmd=bundled_$cmd
if which _$cmd > /dev/null 2>&1; then
- compdef _$cmd bundled_$cmd=$cmd
+ compdef _$cmd bundled_$cmd=$cmd
fi
done
-
diff --git a/plugins/cabal/cabal.plugin.zsh b/plugins/cabal/cabal.plugin.zsh
index 9f76add7a..a9a05b012 100644
--- a/plugins/cabal/cabal.plugin.zsh
+++ b/plugins/cabal/cabal.plugin.zsh
@@ -17,13 +17,16 @@ function _cabal_commands() {
subcommand)
subcommands=(
"bench:Run the benchmark, if any (configure with UserHooks)"
- "build:Make this package ready for installation"
+ "build:Compile all targets or specific target."
"check:Check the package for common mistakes"
"clean:Clean up after a build"
- "copy:Copy teh files into the install locations"
+ "copy:Copy the files into the install locations"
"configure:Prepare to build the package"
+ "exec:Run a command with the cabal environment"
"fetch:Downloads packages for later installation"
- "haddock:Generate HAddock HTML documentation"
+ "freeze:Freeze dependencies."
+ "get:Gets a package's source code"
+ "haddock:Generate Haddock HTML documentation"
"help:Help about commands"
"hscolour:Generate HsColour colourised code, in HTML format"
"info:Display detailed information about a particular package"
@@ -31,7 +34,10 @@ function _cabal_commands() {
"install:Installs a list of packages"
"list:List packages matching a search string"
"register:Register this package with the compiler"
+ "repl:Open an interpreter session for the given target"
"report:Upload build reports to a remote server"
+ "run:Runs the compiled executable"
+ "sandbox:Create/modify/delete a sandbox"
"sdist:Generate a source distribution file (.tar.gz)"
"test:Run the test suite, if any (configure with UserHooks)"
"unpack:Unpacks packages for user inspection"
@@ -45,3 +51,43 @@ function _cabal_commands() {
}
compdef _cabal_commands cabal
+
+function _cab_commands() {
+ local ret=1 state
+ _arguments ':subcommand:->subcommand' && ret=0
+
+ case $state in
+ subcommand)
+ subcommands=(
+ "sync:Fetch the latest package index"
+ "install:Install packages"
+ "uninstall:Uninstall packages"
+ "installed:List installed packages"
+ "configure:Configure a cabal package"
+ "build:Build a cabal package"
+ "clean:Clean up a build directory"
+ "outdated:Display outdated packages"
+ "info:Display information of a package"
+ "sdist:Make tar.gz for source distribution"
+ "upload:Uploading tar.gz to HackageDB"
+ "get:Untar a package in the current directory"
+ "deps:Show dependencies of this package"
+ "revdeps:Show reverse dependencies of this package"
+ "check:Check consistency of packages"
+ "genpaths:Generate Paths_<pkg>.hs"
+ "search:Search available packages by package name"
+ "add:Add a source directory"
+ "test:Run tests"
+ "bench:Run benchmarks"
+ "doc:Generate manuals"
+ "ghci:Run GHCi (with a sandbox)"
+ "init:Initialize a sandbox"
+ "help:Display the help message of the command"
+ )
+ _describe -t subcommands 'cab subcommands' subcommands && ret=0
+ esac
+
+ return ret
+}
+
+command -v cab >/dev/null 2>&1 && { compdef _cab_commands cab }
diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
index 44cc47470..2370df949 100644
--- a/plugins/cake/cake.plugin.zsh
+++ b/plugins/cake/cake.plugin.zsh
@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
fi
[ ! -f ${_cake_task_cache_file} ] && return 0;
- [ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
+ [ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
return 1;
}
diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
index 2a2c80cf6..b461b0c9b 100644
--- a/plugins/chruby/chruby.plugin.zsh
+++ b/plugins/chruby/chruby.plugin.zsh
@@ -24,7 +24,7 @@ _homebrew-installed() {
}
_chruby-from-homebrew-installed() {
- brew --prefix chruby &> /dev/null
+ [ -r $(brew --prefix chruby)] &> /dev/null
}
_ruby-build_installed() {
@@ -45,11 +45,11 @@ _source_from_omz_settings() {
zstyle -s :omz:plugins:chruby path _chruby_path
zstyle -s :omz:plugins:chruby auto _chruby_auto
- if _chruby_path && [[ -r _chruby_path ]]; then
+ if ${_chruby_path} && [[ -r ${_chruby_path} ]]; then
source ${_chruby_path}
fi
- if _chruby_auto && [[ -r _chruby_auto ]]; then
+ if ${_chruby_auto} && [[ -r ${_chruby_auto} ]]; then
source ${_chruby_auto}
fi
}
diff --git a/plugins/chucknorris/.gitignore b/plugins/chucknorris/.gitignore
new file mode 100644
index 000000000..267c504a6
--- /dev/null
+++ b/plugins/chucknorris/.gitignore
@@ -0,0 +1 @@
+fortunes/chucknorris.dat
diff --git a/plugins/chucknorris/LICENSE b/plugins/chucknorris/LICENSE
new file mode 100644
index 000000000..5f40edd1e
--- /dev/null
+++ b/plugins/chucknorris/LICENSE
@@ -0,0 +1,2 @@
+License: GPL v2
+Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.
diff --git a/plugins/chucknorris/chucknorris.plugin.zsh b/plugins/chucknorris/chucknorris.plugin.zsh
new file mode 100644
index 000000000..096364633
--- /dev/null
+++ b/plugins/chucknorris/chucknorris.plugin.zsh
@@ -0,0 +1,6 @@
+if [ ! -f $ZSH/plugins/chucknorris/fortunes/chucknorris.dat ]; then
+ strfile $ZSH/plugins/chucknorris/fortunes/chucknorris $ZSH/plugins/chucknorris/fortunes/chucknorris.dat
+fi
+
+alias chuck="fortune -a $ZSH/plugins/chucknorris/fortunes"
+alias chuck_cow="chuck | cowthink"
diff --git a/plugins/chucknorris/fortunes/chucknorris b/plugins/chucknorris/fortunes/chucknorris
new file mode 100644
index 000000000..b8edf9ac3
--- /dev/null
+++ b/plugins/chucknorris/fortunes/chucknorris
@@ -0,0 +1,904 @@
+Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+The chief export of Chuck Norris is pain.
+%
+If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death.
+%
+Chuck Norris has counted to infinity. Twice.
+%
+Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
+%
+Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
+%
+Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
+%
+In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
+There is no chin behind Chuck Norris' beard. There is only another fist.
+%
+Chuck Norris does not teabag the ladies. He potato-sacks them.
+Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
+%
+When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
+%
+There are no steroids in baseball. Just players Chuck Norris has breathed on.
+%
+Chuck Norris once challenged Lance Armstrong in a "Who has more testicles?" contest. Chuck Norris won by 5.
+%
+Chuck Norris was the fourth wise man, who gave baby Jesus the gift of beard, which he carried with him until he died. The other three wise men were enraged by the preference that Jesus showed to Chuck's gift, and arranged to have him written out of the bible. All three died soon after of mysterious roundhouse-kick related injuries.
+%
+Chuck Norris sheds his skin twice a year.
+%
+When Chuck Norris calls 1-900 numbers, he doesnt get charged. He holds up the phone and money falls out.
+%
+Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.
+%
+Some people like to eat frogs' legs. Chuck Norris likes to eat lizard legs. Hence, snakes.
+%
+There are no races, only countries of people Chuck Norris has beaten to different shades of black and blue.
+%
+When Chuck Norris was denied an Egg McMuffin at McDonald's because it was 10:35, he roundhouse kicked the store so hard it became a Wendy's.
+%
+Chuck Norris can't finish a "color by numbers" because his markers are filled with the blood of his victims. Unfortunately, all blood is dark red.
+%
+A Chuck Norris-delivered Roundhouse Kick is the preferred method of execution in 16 states.
+%
+When Chuck Norris falls in water, Chuck Norris doesn't get wet. Water gets Chuck Norris.
+%
+Scientists have estimated that the energy given off during the Big Bang is roughly equal to 1CNRhK (Chuck Norris Roundhouse Kick)
+%
+Chuck Norris' house has no doors, only walls that he walks through.
+%
+When Chuck Norris has sex with a man, it won't be because he is gay. It will be because he has run out of women.
+%
+How much wood would a woodchuck chuck if a woodchuck could Chuck Norris? ...All of it.
+%
+Chuck Norris doesn't actually write books, the words assemble themselves out of fear.
+%
+In honor of Chuck Norris, all McDonald's in Texas have an even larger size than the super-size. When ordering, just ask to be "Norrisized".
+%
+Chuck Norris CAN believe it's not butter.
+%
+If tapped, a Chuck Norris roundhouse kick could power the country of Australia for 44 minutes.
+%
+Chuck Norris can divide by zero.
+%
+The grass is always greener on the other side, unless Chuck Norris has been there. In that case the grass is most likely soaked in blood and tears.
+%
+A picture is worth a thousand words. A Chuck Norris is worth 1 billion words.
+%
+Newton's Third Law is wrong: Although it states that for each action, there is an equal and opposite reaction, there is no force equal in reaction to a Chuck Norris roundhouse kick.
+%
+Chuck Norris invented his own type of karate. It's called Chuck-Will-Kill.
+%
+When an episode of Walker Texas Ranger was aired in France, the French surrendered to Chuck Norris just to be on the safe side.
+%
+While urinating, Chuck Norris is easily capable of welding titanium.
+%
+Chuck Norris once sued the Houghton-Mifflin textbook company when it became apparent that their account of the war of 1812 was plagiarized from his autobiography.
+%
+When Chuck Norris talks, everybody listens. And dies.
+%
+When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part.
+%
+Wilt Chamberlain claims to have slept with more than 20,000 women in his lifetime. Chuck Norris calls this "a slow Tuesday."
+%
+Contrary to popular belief, there is indeed enough Chuck Norris to go around.
+%
+Chuck Norris doesnt shave; he kicks himself in the face. The only thing that can cut Chuck Norris is Chuck Norris.
+%
+For some, the left testicle is larger than the right one. For Chuck Norris, each testicle is larger than the other one.
+%
+Chuck Norris always knows the EXACT location of Carmen SanDiego.
+%
+When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000.
+%
+Chuck Norris invented black. In fact, he invented the entire spectrum of visible light. Except pink. Tom Cruise invented pink.
+%
+When you're Chuck Norris, anything + anything is equal to 1. One roundhouse kick to the face.
+%
+Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO.
+%
+On his birthday, Chuck Norris randomly selects one lucky child to be thrown into the sun.
+%
+Nobody doesn't like Sara Lee. Except Chuck Norris.
+%
+Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down!
+%
+In the beginning there was nothing...then Chuck Norris Roundhouse kicked that nothing in the face and said "Get a job". That is the story of the universe.
+%
+Chuck Norris has 12 moons. One of those moons is the Earth.
+%
+Chuck Norris grinds his coffee with his teeth and boils the water with his own rage.
+%
+Archeologists unearthed an old english dictionary dating back to the year 1236. It defined "victim" as "one who has encountered Chuck Norris"
+%
+Chuck Norris ordered a Big Mac at Burger King, and got one.
+%
+Chuck Norris and Mr. T walked into a bar. The bar was instantly destroyed, as that level of awesome cannot be contained in one building.
+%
+If you Google search "Chuck Norris getting his ass kicked" you will generate zero results. It just doesn't happen.
+%
+Chuck Norris can drink an entire gallon of milk in thirty-seven seconds.
+%
+Little known medical fact: Chuck Norris invented the Caesarean section when he roundhouse-kicked his way out of his monther's womb.
+%
+Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint.
+The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.
+%
+It takes Chuck Norris 20 minutes to watch 60 Minutes.
+%
+You know how they say if you die in your dream then you will die in real life? In actuality, if you dream of death then Chuck Norris will find you and kill you.
+%
+Chuck Norris has a deep and abiding respect for human life... unless it gets in his way.
+%
+The Bermuda Triangle used to be the Bermuda Square, until Chuck Norris Roundhouse kicked one of the corners off.
+%
+There are no weapons of mass destruction in Iraq, Chuck Norris lives in Oklahoma.
+%
+Chuck Norris doesn't believe in Germany.
+%
+When Chuck Norris is in a crowded area, he doesn't walk around people. He walks through them.
+%
+Chuck Norris once ate an entire bottle of sleeping pills. They made him blink.
+%
+James Cameron wanted Chuck Norris to play the Terminator. However, upon reflection, he realized that would have turned his movie into a documentary, so he went with Arnold Schwarzenegger.
+%
+Chuck Norris can touch MC Hammer.
+%
+Thousands of years ago Chuck Norris came across a bear. It was so terrified that it fled north into the arctic. It was also so terrified that all of its decendents now have white hair.
+%
+Chuck Norris played Russian Roulette with a fully loaded gun and won.
+%
+It takes 14 puppeteers to make Chuck Norris smile, but only 2 to make him destroy an orphanage.
+%
+Chuck Norris is responsible for China's over-population. He hosted a Karate tournament in Beijing and all women within 1,000 miles became pregnant instantly.
+%
+Some people wear Superman pajamas. Superman wears Chuck Norris pajamas.
+%
+Chuck Norris once worked as a weatherman for the San Diego evening news. Every night he would make the same forecast: Partly cloudy with a 75% chance of Pain.
+%
+Simply by pulling on both ends, Chuck Norris can stretch diamonds back into coal.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris invented the bolt-action rifle, liquor, sexual intercourse, and football-- in that order.
+%
+A high tide means Chuck Norris is flying over your coast. The tide is caused by God pissing his pants.
+%
+Chuck Norris keeps his friends close and his enemies closer. Close enough to drop them with one round house kick to the face.
+%
+There is in fact an "I" in Norris, but there is no "team"? not even close.
+%
+Scotty in Star Trek often says "Ye cannae change the laws of physics." This is untrue. Chuck Norris can change the laws of physics. With his fists.
+%
+An anagram for Walker Texas Ranger is KARATE WRANGLER SEX. I don't know what that is, but it sounds AWESOME.
+%
+Chuck Norris doesn't stub his toes. He accidentally destroys chairs, bedframes, and sidewalks.
+%
+Using his trademark roundhouse kick, Chuck Norris once made a fieldgoal in RJ Stadium in Tampa Bay from the 50 yard line of Qualcomm stadium in San Diego.
+%
+Chuck Norris roundhouse kicks don't really kill people. They wipe out their entire existence from the space-time continuum.
+%
+Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold.
+%
+Tom Clancy has to pay royalties to Chuck Norris because "The Sum of All Fears" is the name of Chuck Norris' autobiography.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris is expected to win gold in every swimming competition at the 2008 Beijing Olympics, even though Chuck Norris does not swim. This is because when Chuck Norris enters the water, the water gets out of his way and Chuck Norris simply walks across the pool floor.
+%
+Chuck Norris built a better mousetrap, but the world was too frightened to beat a path to his door.
+%
+The original draft of The Lord of the Rings featured Chuck Norris instead of Frodo Baggins. It was only 5 pages long, as Chuck roundhouse-kicked Sauron's ass halfway through the first chapter.
+%
+Hellen Keller's favorite color is Chuck Norris.
+%
+Chuck Norris eats beef jerky and craps gunpowder. Then, he uses that gunpowder to make a bullet, which he uses to kill a cow and make more beef jerky. Some people refer to this as the "Circle of Life."
+%
+If, by some incredible space-time paradox, Chuck Norris would ever fight himself, he'd win. Period.
+%
+Chuck Norris is currently suing myspace for taking the name of what he calls everything around you.
+%
+The crossing lights in Chuck Norris's home town say "Die slowly" and "die quickly". They each have a picture of Chuck Norris punching or kicking a pedestrian.
+%
+Science Fact: Roundhouse kicks are comprised primarily of an element called Chucktanium.
+%
+The Sherman tank was originaly called the Norris tank until Chuck Norris decided it wasn't tough enough to be associated with him. The Army, for fear of Chuck Norris, renamed the tank and promised to develop a weapon more fitting of his name. To date, no weapon created has been badass enough to be named after Chuck Norris.
+%
+Chuck Norris proved that we are alone in the universe. We weren't before his first space expedition.
+%
+Superman once watched an episode of Walker, Texas Ranger. He then cried himself to sleep.
+%
+Chuck Norris doesn't step on toes. Chuck Norris steps on necks.
+%
+The movie "Delta Force" was extremely hard to make because Chuck had to downplay his abilities. The first few cuts were completely unbelievable.
+%
+Movie trivia: The movie "Invasion U.S.A." is, in fact, a documentary.
+%
+Chuck Norris does not "style" his hair. It lays perfectly in place out of sheer terror.
+%
+There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up.
+%
+A study showed the leading causes of death in the United States are:
+1:Heart disease
+2:Chuck Norris
+3:Cancer
+%
+It's widely believed that Jesus was Chuck Norris' stunt double for crucifixion due to the fact that it is impossible for nails to pierce Chuck Norris' skin.
+%
+Chuck Norris did in fact, build Rome in a day.
+%
+Along with his black belt, Chuck Norris often chooses to wear brown shoes. No one has DARED call him on it. Ever.
+%
+Anytime someone is elected president in the United States, they must ask permission from Chuck Norris to live in the White House. The reason for this is because Chuck Norris had won every Federal, State, and Local election since 1777. He just allows others to run the country in his place.
+%
+Once you go Norris, you are physically unable to go back.
+%
+Ninjas want to grow up to be just like Chuck Norris. But usually they grow up just to be killed by Chuck Norris.
+%
+Chuck Norris once sued Burger King after they refused to put razor wire in his Whopper Jr, insisting that that actually is "his" way.
+%
+The last thing you hear before Chuck Norris gives you a roundhouse kick? No one knows because dead men tell no tales.
+%
+Chuck Norris doesn't play god. Playing is for children.
+%
+As a teen, Chuck Norris had sex with every nun in a convent tucked away in the hills of Tuscany. Nine months later the nuns gave birth to the 1972 Miami Dolphins, the only undefeated and untied team in professional football history.
+%
+Chuck Norris is the only person in the world that can actually email a roundhouse kick.
+%
+Chuck Norris won super bowls VII and VIII singlehandedly before unexpectedly retiring to pursue a career in ass-kicking.
+%
+Wo hu cang long. The translation from Mandarin Chinese reads: "Crouching Chuck, Hidden Norris"
+%
+Chuck Norris can set ants on fire with a magnifying glass. At night.
+%
+Some kids play Kick the can. Chuck Norris played Kick the keg.
+%
+'Icy-Hot' is too weak for Chuck Norris. After a workout, Chuck Norris rubs his muscles down with liquid-hot MAGMA.
+%
+Chuck Norris cannot love, he can only not kill.
+%
+When Chuck Norris was a baby, he didn't suck his mother's breast. His mother served him whiskey, straight out of the bottle.
+%
+According to Einstein's theory of relativity, Chuck Norris can actually roundhouse kick you yesterday.
+%
+Chuck Norris once pulled out a single hair from his beard and skewered three men through the heart with it.
+%
+In an act of great philanthropy, Chuck made a generous donation to the American Cancer Society. He donated 6,000 dead bodies for scientific research.
+%
+Chuck Norris' favourite cut of meat is the roundhouse.
+%
+When J. Robert Oppenheimer said "I am become death, the destroyer Of worlds", He was not referring to the atomic bomb. He was referring to the Chuck Norris halloween costume he was wearing.
+%
+Chuck Norris recently had the idea to sell his urine as a canned beverage. We know this beverage as Red Bull.
+%
+In a recent survey it was discovered the 94% of American women lost their virginity to Chuck Norris. The other 6% were incredibly fat or ugly.
+%
+Chuck Norris invented a language that incorporates karate and roundhouse kicks. So next time Chuck Norris is kicking your ass, don't be offended or hurt, he may be just trying to tell you he likes your hat.
+%
+If at first you don't succeed, you're not Chuck Norris.
+If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass.
+%
+Fear is not the only emotion Chuck Norris can smell. He can also detect hope, as in "I hope I don't get a roundhouse kick from Chuck Norris."
+Too late, asshole.
+%
+Chuck Norris's show is called Walker: Texas Ranger, because Chuck Norris doesn't run.
+%
+MacGyver can build an airplane out of gum and paper clips, but Chuck Norris can roundhouse-kick his head through a wall and take it.
+%
+Behind every successful man, there is a woman. Behind every dead man, there is Chuck Norris.
+%
+What's known as the UFC, or Ultimate Fighting Championship, doesn't use its full name, which happens to be "Ultimate Fighting Championship, Non-Chuck-Norris-Division".
+%
+Chuck Norris brushes his teeth with a mixture of iron shavings, industrial paint remover, and wood-grain alcohol.
+%
+The easiest way to determine Chuck Norris' age is to cut him in half and count the rings.
+%
+There is endless debate about the existence of the human soul. Well it does exist, and Chuck Norris finds it delicious.
+%
+Most boots are made for walkin'. Chuck Norris' boots ain't that merciful.
+%
+The US did not boycott the 1980 Summer Olympics in Moscow due to political reasons: Chuck Norris killed the entire US team with a single round-house kick during TaeKwonDo practice.
+%
+Chuck Norris wears a live rattlesnake as a condom.
+%
+When the movie Pulp Fiction was filmed they had to borrow Chuck Norris's wallet... It's the one that says "Bad Mother Fucker" on it
+%
+The Bible was originally titled "Chuck Norris and Friends"
+%
+Chuck Norris began selling the Total Gym as an ill-fated attempt to make his day-to-day opponents less laughably pathetic.
+%
+Do you know why Baskin Robbins only has 31 flavors? Because Chuck Norris doesn't like Fudge Ripple.
+%
+When Chuck Norris says "More cowbell", he fucking MEANS it.
+%
+On the set of Walker Texas Ranger Chuck Norris brought a dying lamb back to life by nuzzling it with his beard. As the onlookers gathered, the lamb sprang to life. Chuck Norris then roundhouse kicked it, killing it instantly. This was just to prove that the good Chuck giveth, and the good Chuck, he taketh away.
+%
+Chuck Norris was what Willis was talkin' about.
+%
+Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Nagasaki never had a bomb dropped on it. Chuck Norris jumped out of a plane and punched the ground.
+%
+It is scientifically impossible for Chuck Norris to have had a mortal father. The most popular theory is that he went back in time and fathered himself.
+%
+Chuck Norris destroyed the periodic table, because Chuck Norris only recognizes the element of surprise.
+%
+It is believed dinosaurs are extinct due to a giant meteor. That's true if you want to call Chuck Norris a giant meteor.
+%
+Chuck Norris shot the sheriff, but he round house kicked the deputy.
+%
+That's not Chuck Norris doing push-ups -- that's Chuck Norris moving the Earth away from the path of a deadly asteroid.
+%
+Chuck Norris can judge a book by its cover.
+%
+Nothing can escape the gravity of a black hole, except for Chuck Norris. Chuck Norris eats black holes. They taste like chicken.
+%
+Chuck Norris does not play the lottery. It doesn't have nearly enough balls.
+%
+Q: How many Chuck Norris' does it take to change a light bulb?
+A: None, Chuck Norris prefers to kill in the dark.
+%
+As President Roosevelt said: "We have nothing to fear but fear itself. And Chuck Norris."
+%
+Chuck Norris just says "no" to drugs. If he said "yes", it would collapse Colombia's infrastructure.
+%
+Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent. 
+%
+Crime does not pay - unless you are an undertaker following Walker, Texas Ranger, on a routine patrol.
+%
+Chuck Norris invented the internet? just so he had a place to store his porn.
+%
+Chuck Norris does not own a house. He walks into random houses and people move.
+%
+It is better to give than to receive. This is especially true of a Chuck Norris roundhouse kick.
+%
+Chuck Norris is the only person to ever win a staring contest against Ray Charles and Stevie Wonder at the same time.
+%
+Industrial logging isn't the cause of deforestation. Chuck Norris needs toothpicks.
+%
+Chuck Norris smells what the Rock is cooking... because the Rock is Chuck Norris' personal chef.
+%
+When Chuck Norris plays Oregon Trail, his family does not die from cholera or dysentery, but rather, roundhouse kicks to the face. He also requires no wagon, since he carries the oxen, axels, and buffalo meat on his back. He always makes it to Oregon before you.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+"Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
+%
+When God said, "let there be light", Chuck Norris said, "say 'please'."
+%
+Chuck Norris does not eat. Food understands that the only safe haven from Chuck Norris' fists is inside his own body.
+%
+One day Chuck Norris walked down the street with a massive erection. There were no survivors.
+%
+Chuck Norris built a time machine and went back in time to stop the JFK assassination. As Oswald shot, Chuck met all three bullets with his beard, deflecting them. JFK's head exploded out of sheer amazement.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+Chuck Norris uses a night light. Not because Chuck Norris is afraid of the dark, but the dark is afraid of Chuck Norris.
+%
+Chuck Norris is not capable of hitting a target on the broad side of a barn. Every time he tries, the whole damn barn falls down.
+%
+Before each filming of Walker: Texas Ranger, Chuck Norris is injected with fourteen times the lethal dose of elephant tranquilzer. This is, of course, to limit his strength and mobility, in an attempt to lower the fatality rate of the actors he fights.
+%
+When Bruce Banner gets mad, he turns into the Hulk. When the Hulk gets mad, he turns into Chuck Norris.
+%
+Chuck Norris kills anyone that asks, "You want fries with that" because by now everyone should know that Chuck doesn't ever want fries with anything. Ever.
+%
+Chuck Norris once kicked a horse in the chin. Its decendants are known today as Giraffes.
+%
+Sticks and stones may break your bones, but a Chuck Norris glare will liquefy your kidneys.
+%
+Human cloning is outlawed because if Chuck Norris were cloned, then it would be possible for a Chuck Norris roundhouse kick to meet another chuck Norris roundhouse kick. Physicists theorize that this contact would end the universe.
+%
+Chuck Norris once went skydiving, but promised never to do it again. One Grand Canyon is enough.
+%
+Chuck Norris's version of a "chocolate milkshake" is a raw porterhouse wrapped around ten Hershey bars, and doused in diesel fuel.
+%
+If Chuck Norris round-house kicks you, you will die. If Chuck Norris' misses you with the round-house kick, the wind behind the kick will tear out your pancreas.
+%
+In a fight between Batman and Darth Vader, the winner would be Chuck Norris.
+%
+Chuck Norris puts his pants on one leg at a time, just like the rest of us. The only difference is, then he fucking kills people.
+%
+Everybody loves Raymond. Except Chuck Norris.
+%
+Contrary to popular belief, the Titanic didn't hit an iceberg. The ship was off course and accidentally ran into Chuck Norris while he was doing the backstroke across the Atlantic.
+%
+Chuck Norris got his drivers license at the age of 16. Seconds.
+%
+The original title for Alien vs. Predator was Alien and Predator vs Chuck Norris. The film was cancelled shortly after going into preproduction. No one would pay nine dollars to see a movie fourteen seconds long.
+%
+Chuck Norris' sperm is so badass, he had sex with Nicole Kidman, and 7 months later she prematurely gave birth to a Ford Excursion.
+%
+Chuck Norris can win at solitaire with only 18 cards.
+%
+Chuck Norris once shat blood - the blood of 11,940 natives he had killed and eaten.
+%
+Maslow's theory of higher needs does not apply to Chuck Norris. He only has two needs: killing people and finding people to kill.
+%
+The truth will set you free. Unless Chuck Norris has you, in which case, forget it buddy!
+%
+For most people, home is where the heart is. For Chuck Norris, home is where he stores his collection of human skulls.
+%
+Kryptonite has been found to contain trace elements of Chuck Norris roundhouse kicks to the face. This is why it is so deadly to Superman.
+%
+Saddam Hussein was not found hiding in a "hole." Saddam was roundhouse-kicked in the head by Chuck Norris in Kansas, which sent him through the earth, stopping just short of the surface of Iraq.
+%
+Coroners refer to dead people as "ABC's". Already Been Chucked.
+%
+Chuck Norris doesn't look both ways before he crosses the street... he just roundhouses any cars that get too close.
+%
+Chuck Norris does not have to answer the phone. His beard picks up the incoming electrical impulses and translates them into audible sound.
+%
+How many roundhouse kicks does it take to get to the center of a tootsie pop? Just one. From Chuck Norris.
+%
+Chuck Norris doesnt wear a watch, HE decides what time it is.
+%
+The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm, indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
+%
+When chuck Norris does division, there are no remainders.
+%
+If you rearrange the letters in "Chuck Norris", they also spell "Crush Rock In". The words "with his fists" are understood.
+%
+Never look a gift Chuck Norris in the mouth, because he will bite your damn eyes off.
+%
+Give a man a fish, and you will feed him for a day. Give a man anything that is better than a fish, and Chuck Norris will beat his ass and take it.
+%
+Chuck Norris used to play baseball. When Babe Ruth was hailed as the better player, Chuck Norris killed him with a baseball bat to the throat. Lou Gehrig got off easy.
+%
+The original title for Star Wars was "Skywalker: Texas Ranger". Starring Chuck Norris.
+%
+Guantuanamo Bay, Cuba, is the military code-word for "Chuck Norris' basement".
+%
+The phrase 'balls to the wall' was originally conceived to describe Chuck Norris entering any building smaller than an aircraft hangar.
+%
+Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
+%
+Ozzy Osbourne bites the heads off of bats. Chuck Norris bites the heads off of Siberian Tigers.
+%
+He who lives by the sword, dies by the sword. He who lives by Chuck Norris, dies by the roundhouse kick.
+%
+The best-laid plans of mice and men often go awry. Even the worst-laid plans of Chuck Norris come off without a hitch.
+%
+The phrase 'dead ringer' refers to someone who sits behind Chuck Norris in a movie theater and forgets to turn their cell phone off.
+%
+Chuck Norris' Roundhouse kick is so powerful, that on the set of Sidekicks he single-footedly destroyed Jonathan Brandis' Career.
+%
+Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face.
+%
+Chuck Norris can taste lies.
+%
+Chuck Norris does not kick ass and take names. In fact, Chuck Norris kicks ass and assigns the corpse a number. It is currently recorded to be in the billions.
+%
+One time, Chuck Norris accidentally stubbed his toe. It destroyed the entire state of Ohio.
+%
+Little Miss Muffet sat on her tuffet, until Chuck Norris roundhouse kicked her into a glacier.
+%
+In 1990, Chuck Norris founded the non-profit organization "Kick Drugs Out of America". If the organization's name were "Roundhouse Kick Drugs out of America", there wouldn't be any drugs in the Western Hemisphere. Anywhere.
+%
+Chuck Norris can blow bubbles with beef jerky.
+%
+They had to edit the first ending of 'Lone Wolf McQuade' after Chuck Norris kicked David Carradine's ass, then proceeded to barbecue and eat him.
+%
+Chuck Norris does, in fact, live in a round house.
+%
+Chuck Norris was once on Jeopardy. This show is notable in that it was the first occasion in Jeopardy history that Alex Trebek had appeared without a mustache. And a head.
+%
+When Chuck Norris works out on the Total Gym, the Total Gym feels like it's been raped.
+%
+4 out of 5 doctors fail to recommend Chuck Norris as a solution to most problems. Also, 80% of doctors die unexplained, needlessly brutal deaths.
+%
+Chuck Norris can skeletize a cow in two minutes.
+%
+The only sure things are Death and Taxes?and when Chuck Norris goes to work for the IRS, they'll be the same thing.
+Chuck Norris' first job was as a paperboy. There were no survivors.
+%
+With the rising cost of gasoline, Chuck Norris is beginning to worry about his drinking habit.
+%
+The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death.
+%
+Chuck Norris' testicles do not produce sperm. They produce tiny white ninjas that recognize only one mission: seek and destroy.
+%
+To be or not to be? That is the question. The answer? Chuck Norris.
+%
+Chuck Norris has never been in a fight, ever. Do you call one roundhouse kick to the face a fight?
+%
+There are two types of people in the world... people that suck, and Chuck Norris.
+%
+Chuck Norris never wet his bed as a child. The bed wet itself out of fear.
+%
+If you were somehow able to land a punch on Chuck Norris your entire arm would shatter upon impact. This is only in theory, since, come on, who in their right mind would try this?
+%
+70% of a human's weight is water. 70% of Chuck Norris' weight is his dick.
+%
+Jean-Claude Van Damme once kicked Chuck Norris' ass. He was then awakened from his dream by a roundhouse kick to the face.
+%
+The pie scene in "American Pie" is based on a dare Chuck Norris took when he was younger. However, in Chuck Norris' case, the "pie" was the molten crater of an active volcano.
+%
+Chuck Norris uses 8'x10' sheets of plywood as toilet paper.
+%
+Noah was the only man notified before Chuck Norris relieved himself in the Atlantic Ocean.
+%
+Chuck Norris once invited all of the other badasses from TV to duke it out in order to see who was the supreme badass. Only two showed up-- Jack Bauer and MacGyver.
+%
+
+%
+MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.
+%
+Jack Bauer tried to use his detailed knowledge of torture techniques, but to no avail: Chuck Norris thrives on pain. Chuck Norris then ripped off Jack Bauer's arm and beat him to death with it. Game, set, match.
+%
+Chuck Norris eats steak for every single meal. Most times he forgets to kill the cow.
+%
+The First Law of Thermodynamics states that energy can neither be created nor destroyed... unless it meets Chuck Norris.
+%
+Chuck Norris doesn't go on the internet, he has every internet site stored in his memory. He refreshes webpages by blinking.
+%
+Fact: Chuck Norris doesn't consider it sex if the woman survives.
+%
+It is said that looking into Chuck Norris' eyes will reveal your future. Unfortunately, everybody's future is always the same: death by a roundhouse-kick to the face.
+%
+Chuck Norris knows everything there is to know - Except for the definition of mercy.
+%
+Scientifically speaking, it is impossible to charge Chuck Norris with "obstruction of justice." This is because even Chuck Norris cannot be in two places at the same time.
+%
+Chuck Norris never has to wax his skis because they're always slick with blood.
+%
+When you say "no one's perfect", Chuck Norris takes this as a personal insult.
+%
+Chuck Norris can win a game of Trivial Pursuit with one roll of the dice, and without answering a single question... just a nod of the head, and a stroke of the beard.
+%
+182,000 Americans die from Chuck Norris-related accidents every year.
+%
+Paper beats rock, rock beats scissors, and scissors beats paper, but Chuck Norris beats all 3 at the same time.
+%
+Jesus can walk on water, but Chuck Norris can walk on Jesus.
+%
+All roads lead to Chuck Norris. And by the transitive property, a roundhouse kick to the face.
+%
+If you're driving down the road and you think Chuck Norris just cut you off, you better thank your lucky stars it wasn't the other way around.
+%
+July 4th is Independence day. And the day Chuck Norris was born. Coincidence? i think not.
+%
+Chuck Norris never goes to the dentist because his teeth are unbreakable. His enemies never go to the dentist because they have no teeth.
+%
+In the medical community, death is referred to as "Chuck Norris Disease"
+%
+Chuck Norris was once in a knife fight, and the knife lost.
+%
+If you work in an office with Chuck Norris, don't ask him for his three-hole-punch.
+%
+In the Words of Julius Caesar, "Veni, Vidi, Vici, Chuck Norris". Translation: I came, I saw, and I was roundhouse-kicked inthe face by Chuck Norris.
+%
+The First rule of Chuck Norris is: you do not talk about Chuck Norris.
+%
+Chuck Norris is widely predicted to be first black president. If you're thinking to yourself, "But Chuck Norris isn't black", then you are dead wrong. And stop being a racist.
+%
+When Chuck Norris plays Monopoly, it affects the actual world economy.
+%
+Chuck Norris can be unlocked on the hardest level of Tekken. But only Chuck Norris is skilled enough to unlock himself. Then he roundhouse kicks the Playstation back to Japan.
+%
+Chuck Norris drinks napalm to quell his heartburn.
+%
+Every time someone uses the word "intense", Chuck Norris always replies "you know what else is intense?" followed by a roundhouse kick to the face.
+%
+As an infant, Chuck Norris' parents gave him a toy hammer. He gave the world Stonehenge.
+%
+Chuck Norris once ordered a steak in a restaurant. The steak did what it was told.
+%
+Most people fear the Reaper. Chuck Norris considers him "a promising Rookie".
+%
+There are only two things that can cut diamonds: other diamonds, and Chuck Norris.
+%
+President Roosevelt once rode his horse 100 miles. Chuck Norris carried his the same distance in half the time.
+%
+Chuck Norris once ate four 30lb bowling balls without chewing.
+%
+What many people dont know is chuck norris is the founder of planned parenthood. Not even unborn children can escape his wrath.
+%
+Chuck Norris was banned from competitive bullriding after a 1992 exhibition in San Antonio, when he rode the bull 1,346 miles from Texas to Milwaukee Wisconsin to pick up his dry cleaning.
+%
+Chuck Norris qualified with a top speed of 324 mph at the Daytona 500, without a car.
+%
+Chuck Norris likes his coffee half and half: half coffee grounds, half wood-grain alcohol.
+%
+Chuck Norris uses tabasco sauce instead of visine.
+%
+The chemical formula for the highly toxic cyanide ion is CN-. These are also Chuck Norris' initials. This is not a coincidence.
+%
+Chuck Norris' credit cards have no limit. Last weekend, he maxed them out.
+%
+Think of a hot woman. Chuck Norris did her.
+%
+A man once claimed Chuck Norris kicked his ass twice, but it was promptly dismissed as false - no one could survive it the first time.
+%
+Chuck Norris sleeps with a pillow under his gun.
+%
+Chuck Norris owns a chain of fast-food restaurants throughout the southwest. They serve nothing but barbecue-flavored ice cream and Hot Pockets.
+%
+Chuck Norris doesn't chew gum. Chuck Norris chews tin foil.
+%
+Aliens DO indeed exist. They just know better than to visit a planet that Chuck Norris is on.
+%
+When in a bar, you can order a drink called a "Chuck Norris". It is also known as a "Bloody Mary", if your name happens to be Mary.
+%
+Every time Chuck Norris smiles, someone dies. Unless he smiles while he's roundhouse kicking someone in the face. Then two people die.
+%
+Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag.
+%
+There's an order to the universe: space, time, Chuck Norris.... Just kidding, Chuck Norris is first.
+%
+A man once asked Chuck Norris if his real name is "Charles". Chuck Norris did not respond, he simply stared at him until he exploded.
+%
+Chuck Norris starts everyday with a protein shake made from Carnation Instant Breakfast, one dozen eggs, pure Colombian cocaine, and rattlesnake venom. He injects it directly into his neck with a syringe.
+%
+In a tagteam match, Chuck Norris was teamed with Hulk Hogan against King Kong Bundy and Andre The Giant. He pinned all 3 at the same time.
+%
+Chuck Norris doesn't see dead people. He makes people dead.
+%
+Chuck Norris is the only person who can simultaneously hold and fire FIVE Uzis: One in each hand, one in each foot -- and the 5th one he roundhouse-kicks into the air, so that it sprays bullets.
+%
+For undercover police work, Chuck Norris pins his badge underneath his shirt, directly into his chest.
+%
+In the X-Men movies, none of the X-Men super-powers are done with special effects. Chuck Norris is the stuntman for every character.
+%
+We live in an expanding universe. All of it is trying to get away from Chuck Norris.
+%
+Chuck Norris went looking for a bar but couldn't find one. He walked to a vacant lot and sat there. Sure enough within an hour an a half someone constructed a bar around him. He then ordered a shot, drank it, and then burned the place to the ground. Chuck Norris yelled over the roar of the flames, "always leave things the way you found em!"
+%
+It is said that every time you masturbate, God kills a kitten. Every time God masturbates, Chuck Norris kills a lion.
+%
+The word 'Kill' was invented by Chuck Norris. Other words were 'Die', 'Beer', and 'What'.
+%
+Chuck Norris is a vegetarian. Meaning, he does not eat animals until first he puts them into vegetative state with his fists.
+%
+The 11th commandment is "Thou shalt not piss off Chuck Norris" This commandment is rarely enforced, as it is impossible to accomplish.
+%
+Chuck Norris is his own line at the DMV.
+%
+Two wrongs don't make a right. Unless you're Chuck Norris. Then two wrongs make a roundhouse kick to the face.
+%
+Who let the dogs out? Chuck Norris let the dogs out... and then roundhouse kicked them through an Oldsmobile.
+%
+Chuck Norris can do a roundhouse kick faster than the speed of light. This means that if you turn on a light switch, you will be dead before the lightbulb turns on.
+%
+When Chuck Norris goes to out to eat, he orders a whole chicken, but he only eats its soul.
+%
+Chuck Norris sold his soul to the devil for his rugged good looks and unparalleled martial arts ability. Shortly after the transaction was finalized, Chuck roundhouse-kicked the devil in the face and took his soul back. The devil, who appreciates irony, couldn't stay mad and admitted he should have seen it coming. They now play poker every second Wednesday of the month.
+%
+Chuck Norris has never won an Academy Award for acting... because he's not acting.
+%
+If Chuck Norris wants your opinion, he'll beat it into you.
+%
+Not everyone that Chuck Norris is mad at gets killed. Some get away. They are called astronauts.
+%
+Chuck Norris has to register every part of his body as a separate lethal weapon. His spleen is considered a concealed weapon in over 50 states.
+%
+A movie scene depicting Chuck Norris losing a fight with Bruce Lee was the product of history's most expensive visual effect. When adjusted for inflation, the effect cost more than the Gross National Product of Paraguay.
+%
+Godzilla is a Japanese rendition of Chuck Norris' first visit to Tokyo.
+%
+They once made a Chuck Norris toilet paper, but there was a problem-- It wouldn't take shit from anybody.
+%
+Chuck Norris once rode a nine foot grizzly bear through an automatic car wash, instead of taking a shower.
+%
+"Sweating bullets" is literally what happens when Chuck Norris gets too hot.
+%
+Chuck Norris' sperm can be seen with the naked eye. Each one is the size of a quarter.
+%
+After taking a steroids test doctors informed Chuck Norris that he had tested positive. He laughed upon receiving this information, and said "of course my urine tested positive, what do you think they make steroids from?"
+%
+Chuck Norris doesn't daydream. He's too busy giving other people nightmares.
+%
+When Arnold says the line "I'll be back" in the first Terminator movie it is implied that is he going to ask Chuck Norris for help.
+%
+There are no such things as tornados. Chuck Norris just hates trailer parks.
+%
+Chuck Norris' Penis is a third degree blackbelt, and an honorable 32nd-degree mason.
+%
+Chuck Norris does not follow fashion trends, they follow him. But then he turns around and kicks their ass. Nobody follows Chuck Norris.
+%
+The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
+%
+Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
+%
+Diamonds are not, despite popular belief, carbon. They are, in fact, Chuck Norris fecal matter. This was proven a recently, when scientific analysis revealed what appeared to be Jean-Claude Van Damme bone fragments inside the Hope Diamond.
+%
+Chuck Norris once participated in the running of the bulls. He walked.
+%
+The Drummer for Def Leppard's only got one arm. Chuck Norris needed a back scratcher.
+%
+Chuck Norris was the orginal sculptor of Mount Rushmore. He completed the entire project using only a bottle opener and a drywall trowel.
+%
+Chuck Norris once rode a bull, and nine months later it had a calf.
+%
+Chuck Norris once lost the remote, but maintained control of the TV by yelling at it in between bites of his "Filet of Child" sandwich.
+%
+For Spring Break '05, Chuck Norris drove to Madagascar, riding a chariot pulled by two electric eels.
+%
+The Manhattan Project was not intended to create nuclear weapons, it was meant to recreate the destructive power in a Chuck Norris Roundhouse Kick. They didn't even come close.
+%
+Chuck Norris has banned rainbows from the state of North Dakota.
+%
+Divide Chuck Norris by zero and you will in fact get one........one bad-ass motherfucker that is.
+%
+TNT was originally developed by Chuck Norris to cure indigestion.
+%
+After returning from World War 2 unscathed, Bob Dole was congratulated by Chuck Norris with a handshake. The rest is history.
+%
+Chuck Norris runs on batteries. Specifically, Die Hards.
+%
+"Let the Bodies Hit the Floor" was originally written as Chuck Norris' theme song.
+%
+Chuck Norris will never have a heart attack. His heart isn't nearly foolish enough to attack him.
+%
+Only Chuck Norris can prevent forest fires.
+%
+When Chuck Norris makes a burrito, its main ingredient is real toes.
+%
+Chuck Norris is not Irish. His hair is soaked in the blood of his victims.
+%
+In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard.
+%
+Chuck Norris' dick is so big, it has it's own dick, and that dick is still bigger than yours.
+%
+They say curiosity killed the cat. This is false. Chuck Norris killed the cat. Every single one of them.
+%
+There is no such thing as a lesbian, just a woman who has never met Chuck Norris.
+%
+Chuck Norris crossed the road. No one has ever dared question his motives.
+%
+When Chuck Norris was born, he immediately had sex with the first nurse he saw. He was her first. She was his third. That afternoon.
+%
+One time, at band camp, Chuck Norris ate a percussionist.
+%
+Chuck Norris doesn't say "who's your daddy", because he knows the answer.
+%
+Chuck Norris originally wrote the first dictionary. The definition for each word is as follows - A swift roundhouse kick to the face.
+%
+Love does not hurt. Chuck Norris does.
+%
+The term "Cleveland Steamer" got its name from Chuck Norris, when he took a dump while visiting the Rock and Roll Hall of fame and buried northern Ohio under a glacier of fecal matter.
+%
+Chuck Norris once round-house kicked a salesman. Over the phone.
+%
+The pen is mighter than the sword, but only if the pen is held by Chuck Norris.
+%
+Chuck Norris doesn't kill two birds with one stone. Chuck Norris kills all birds, with two stones. The ones in his pants.
+%
+Chuck Norris knows the last digit of pi.
+%
+Those aren't credits that roll after Walker Texas Ranger. It is actually a list of fatalities that occurred during the making of the episode.
+%
+The air around Chuck Norris is always a balmy 78 degrees.
+%
+When Chuck Norris wants an egg, he cracks open a chicken.
+%
+Chuck Norris plays racquetball with a waffle iron and a bowling ball.
+%
+According to the Bible, God created the universe in six days. Before that, Chuck Norris created God by snapping his fingers.
+%
+Chuck Norris doesn't believe in ravioli. He stuffs a live turtle with beef and smothers it in pig's blood.
+%
+Count from one to ten. That's how long it would take Chuck Norris to kill you...Fourty seven times.
+%
+The 1972 Miami Dolphins lost one game, it was an exhibition game vs. Chuck Norris and three seven year old girls. Chuck Norris won with a roundhouse-kick to the face in overtime.
+%
+Chuck Norris is not Politically Correct. He is just Correct. Always.
+%
+Mr. T pities the fool. Chuck Norris rips the fool's fucking head off.
+%
+Chuck Norris had to stop washing his clothes in the ocean. The tsunamis were killing people.
+%
+Chuck Norris has volunteered to remain on earth after the Rapture; he will spend his time fighting the Anti-Christ.
+%
+They were going to release a Chuck Norris edition of Clue, but the answer always turns out to be "Chuck Norris. In The Library. With a Roundhouse Kick."
+%
+Chuck Norris is the only known mammal in history to have an opposable thumb. On his penis.
+%
+A man once taunted Chuck Norris with a bag of Lay's potato chips, saying "Betcha can't eat just one!" Chuck Norris proceeded to eat the chips, the bag, and the man in one deft move.
+%
+Chuck Norris' favorite cereal is Kellogg's Nails 'N' Gravel.
+%
+In the first Jurassic Park movie, the Tyrannosaurus Rex wasn't chasing the jeep. Chuck Norris was chasing the Tyrannosaurus AND the jeep.
+%
+Chuck Norris has never been accused of murder for the simple fact that his roundhouse kicks are recognized world-wide as "acts of God."
+%
+"Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
+%
+Chuck Norris does not wear a condom. Because there is no such thing as protection from Chuck Norris.
+%
+Chuck Norris once had sex with a cigarette machine in the Osaka airport.
+%
+Rules of fighting: 1) Don't bring a knife to a gun fight. 2) Don't bring a gun to a Chuck Norris fight.
+%
+Chuck Norris is the only man who has, literally, beaten the odds. With his fists.
+%
+In ancient China there is a legend that one day a child will be born from a dragon, grow to be a man, and vanquish evil from the land. That man is not Chuck Norris, because Chuck Norris killed that man.
+%
+Chuck Norris wipes his ass with chain mail and sandpaper.
+%
+When you play Monopoly with Chuck Norris, you do not pass go, and you do not collect two hundred dollars. You will be lucky if you make it out alive.
+%
+Chuck Norris describes human beings as "a sociable holder for blood and guts".
+%
+Chuck Norris once got into a fight with a one-armed Ninja. Seeing that he had an unfair advantage, Chuck Norris ripped both of his arms off and one of his legs. He then roundhouse-kicked the ninja in the head, killing him instantly, and proceeded to sow his limbs back on using only a rusty tent spike and bailing wire.
+%
+Chuck Norris likes his ice like he likes his skulls: crushed.
+%
+Chuck Norris can kick through all 6 degrees of separation, hitting anyone, anywhere, in the face, at any time.
+%
+Most tough men eat nails for breakfast. chuck Norris does all of his grocery shopping at Home Depot.
+%
+Chuck Norris did not "lose" his virginity, he stalked it and then destroyed it with extreme prejudice.
+%
+Everything King Midas touches turnes to gold. Everything Chuck Norris touches turns up dead.
+%
+Chuck Norris' pulse is measured on the richter scale.
+%
+Most people know that Descarte said, "I think, therefore I am." What most people don't know is that that quote continues, "...afraid of Chuck Norris."
+%
+Chuck Norris once roundhouse-kicked a ten dollar bill into 200 nickels.
+%
+For every movie about Vietnam starring Chuck Norris, the historical duration of the war decreases. Just 3 more "Missing in Action" sequels, and that war will have never actually existed.
+%
+Chuck Norris' penis has a Hemi.
+%
+Chuck Norris enjoys a good practical joke. His favorite is where he removes your lower intestine and pretends to make a balloon animal out of it. Then he cracks your skull open with a Volvo for not complimenting him on his balloon animal.
+%
+Chuck Norris CAN in fact 'raise the roof'. And he can do it with one hand.
+%
+Kenny G is allowed to live because Chuck Norris doesn't kill women.
+%
+Life is not, in fact, like a box of chocolates. It is more like a box of Chuck Norris, roundhouse kicking you in the face. And if you receive a box of Chuck Norris, you ALWAYS know what you are going to get.
+%
+For Chuck Norris, every street is "one way". HIS WAY.
+%
+There are now five cup sizes at Starbucks: Short, Tall, Grande, Venti, and Chuck Norris.
+%
+During the Vietnam War, Chuck Norris allowed himself to be captured. For torture, they made him eat his own entrails. He asked for seconds.
+%
+Chuck Norris once created a flamethrower by urinating into a lighter.
+%
+Instead of having a cigarette after sex, Chuck Norris heads outside and brands his cattle.
+%
+Chuck Norris actually built the stairway to heaven.
+%
+Whoever said "only the good die young" was probably in Chuck Norris's kindergarten class.
+%
+Chuck Norris once skewered a man with the Eiffel tower.
+%
+The best part of waking up, is not Folgers in your cup, but knowing that Chuck Norris didn't kill you in your sleep.
+%
+Chuck Norris doesn't own a can opener, he just chews through the can.
+%
+Occam's Razor says that the simplest answer tends to be the correct one. Norris' Razor involves a flick of the wrist and a Columbian Necktie.
+%
+Chuck Norris needs a monkeywrench and a blowtorch to masturbate.
+%
+Proponents of higher-order theories of consciousness argue that consciousness is explained by the relation between two levels of mental states in which a higher-order mental state takes another mental state. If you mention this to Chuck Norris, expect an explosive roundhouse kick to the face for spouting too much fancy-talk.
+%
+Chuck Norris invented all 32 letters of the alphabet.
+%
+Remember The Ultimate Warrior? He quit wrestling because Chuck Norris wanted his nickname back.
+%
+If a tree falls in the forest, does anybody hear? Yes. Chuck Norris hears it. Chuck Norris can hear everything. Chuck Norris can hear the shrieking terror in your soul.
+%
+Chuck Norris actually owns IBM. It was an extremely hostile takeover.
+%
+He, who laughs last, laughs best. He who laughs at Chuck Norris ? dies.
+%
+Chuck Norris is like a dog, not only because he can smell fear, but because he can piss on whatever the fuck he wants.
+%
+Chuck Norris can jump-start a car using jumper cables attached to his nipples.
+%
+Chuck Norris neither melts in your mouth nor in your hand. He shreds your trachea before ravaging your soul with a combination of chocolate, whickey, roundhouse kicks and death. Oh, and pain. Lots of pain.
+%
+Chuck Norris doesn't have blood. He is filled with magma.
+%
diff --git a/plugins/colemak/colemak.plugin.zsh b/plugins/colemak/colemak.plugin.zsh
index 34d42c280..cb7cc5068 100644
--- a/plugins/colemak/colemak.plugin.zsh
+++ b/plugins/colemak/colemak.plugin.zsh
@@ -19,4 +19,4 @@ bindkey -a 'N' vi-join
bindkey -a 'j' vi-forward-word-end
bindkey -a 'J' vi-forward-blank-word-end
-lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less
+lesskey $ZSH/plugins/colemak/colemak-less
diff --git a/plugins/colored-man/colored-man.plugin.zsh b/plugins/colored-man/colored-man.plugin.zsh
index 56056284a..5c613f49d 100644
--- a/plugins/colored-man/colored-man.plugin.zsh
+++ b/plugins/colored-man/colored-man.plugin.zsh
@@ -1,3 +1,21 @@
+if [ "$OSTYPE[0,7]" = "solaris" ]
+then
+ if [ ! -x ${HOME}/bin/nroff ]
+ then
+ 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} "\$@"
+fi
+#-- Some other invocation of nroff
+exec /usr/bin/nroff "\$@"
+EOF
+ chmod +x ${HOME}/bin/nroff
+ fi
+fi
+
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
@@ -7,5 +25,8 @@ man() {
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 "$@"
}
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index 0696607d9..11b58e69d 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -1,4 +1,4 @@
-# Plugin for highligthing file content
+# Plugin for highlighting file content
# Plugin highlights file content based on the filename extension.
# If no highlighting method supported for given extension then it tries
# guess it by looking for file content.
@@ -6,9 +6,9 @@
alias colorize='colorize_via_pygmentize'
colorize_via_pygmentize() {
- if [ ! -x $(which pygmentize) ]; then
- echo package \'pygmentize\' is not installed!
- exit -1
+ if [ ! -x "$(which pygmentize)" ]; then
+ echo "package \'pygmentize\' is not installed!"
+ return -1
fi
if [ $# -eq 0 ]; then
@@ -25,4 +25,4 @@ colorize_via_pygmentize() {
pygmentize -g "$FNAME"
fi
done
-} \ No newline at end of file
+}
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
index f3d7ec2df..797554a13 100644
--- a/plugins/command-not-found/command-not-found.plugin.zsh
+++ b/plugins/command-not-found/command-not-found.plugin.zsh
@@ -7,3 +7,19 @@
# Arch Linux command-not-found support, you must have package pkgfile installed
# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
+
+# Fedora command-not-found support
+if [ -f /usr/libexec/pk-command-not-found ]; then
+ command_not_found_handler () {
+ runcnf=1
+ retval=127
+ [ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0
+ [ ! -x /usr/libexec/packagekitd ] && runcnf=0
+ if [ $runcnf -eq 1 ]
+ then
+ /usr/libexec/pk-command-not-found $@
+ retval=$?
+ fi
+ return $retval
+ }
+fi
diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh
index b19650fee..e3830adcf 100644
--- a/plugins/common-aliases/common-aliases.plugin.zsh
+++ b/plugins/common-aliases/common-aliases.plugin.zsh
@@ -3,7 +3,6 @@
#
# ls, the common ones I use a lot shortened for rapid fire usage
-alias ls='ls --color' #I like color
alias l='ls -lFh' #size,show type,human readable
alias la='ls -lAFh' #long list,show almost all,show type,human readable
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
@@ -21,12 +20,6 @@ alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f'
-# because typing 'cd' is A LOT of work!!
-alias ..='cd ../'
-alias ...='cd ../../'
-alias ....='cd ../../../'
-alias .....='cd ../../../../'
-
# Command line head / tail shortcuts
alias -g H='| head'
alias -g T='| tail'
@@ -39,7 +32,7 @@ alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
alias -g P="2>&1| pygmentize -l pytb"
-alias dud='du --max-depth=1 -h'
+alias dud='du -d 1 -h'
alias duf='du -sh *'
alias fd='find . -type d -name'
alias ff='find . -type f -name'
@@ -47,7 +40,6 @@ alias ff='find . -type f -name'
alias h='history'
alias hgrep="fc -El 0 | grep"
alias help='man'
-alias j='jobs'
alias p='ps -f'
alias sortnr='sort -n -r'
alias unexport='unset'
diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
index 9975aaca4..86f5be3d0 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 () {
- composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+ $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
}
_composer_get_required_list () {
- composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
+ $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
}
_composer () {
@@ -20,29 +20,33 @@ _composer () {
_arguments \
'1: :->command'\
'*: :->args'
- if [ -f composer.json ]; then
- case $state in
- command)
- compadd `_composer_get_command_list`
- ;;
- *)
- compadd `_composer_get_required_list`
- ;;
- esac
- else
- compadd create-project init search selfupdate show
- fi
+
+ case $state in
+ command)
+ compadd $(_composer_get_command_list)
+ ;;
+ *)
+ compadd $(_composer_get_required_list)
+ ;;
+ esac
}
compdef _composer composer
+compdef _composer composer.phar
# Aliases
alias c='composer'
alias csu='composer self-update'
alias cu='composer update'
+alias cr='composer require'
alias ci='composer install'
alias ccp='composer create-project'
alias cdu='composer dump-autoload'
+alias cgu='composer global update'
+alias cgr='composer global require'
# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'
+
+# Add Composer's global binaries to PATH
+export PATH=$PATH:~/.composer/vendor/bin
diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
index 46a0ab268..1e31105b1 100644
--- a/plugins/dircycle/dircycle.plugin.zsh
+++ b/plugins/dircycle/dircycle.plugin.zsh
@@ -1,10 +1,37 @@
-##
-# dircycle plugin: enables cycling through the directory
-# stack using Ctrl+Shift+Left/Right
+# enables cycling through the directory stack using
+# Ctrl+Shift+Left/Right
+#
+# left/right direction follows the order in which directories
+# were visited, like left/right arrows do in a browser
-eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
+# NO_PUSHD_MINUS syntax:
+# pushd +N: start counting from left of `dirs' output
+# pushd -N: start counting from right of `dirs' output
+
+insert-cycledleft () {
+ emulate -L zsh
+ setopt nopushdminus
+
+ builtin pushd -q +1 &>/dev/null || true
+ zle reset-prompt
+}
zle -N insert-cycledleft
-bindkey "\e[1;6D" insert-cycledleft
-eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }"
+
+insert-cycledright () {
+ emulate -L zsh
+ setopt nopushdminus
+
+ builtin pushd -q -0 &>/dev/null || true
+ zle reset-prompt
+}
zle -N insert-cycledright
-bindkey "\e[1;6C" insert-cycledright
+
+
+# add key bindings for iTerm2
+if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+ bindkey "^[[1;6D" insert-cycledleft
+ bindkey "^[[1;6C" insert-cycledright
+else
+ bindkey "\e[1;6D" insert-cycledleft
+ bindkey "\e[1;6C" insert-cycledright
+fi \ No newline at end of file
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
index 504d7ec14..d101cfcae 100644
--- a/plugins/dirhistory/dirhistory.plugin.zsh
+++ b/plugins/dirhistory/dirhistory.plugin.zsh
@@ -3,7 +3,7 @@
# that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
#
-dirhistory_past=(`pwd`)
+dirhistory_past=($PWD)
dirhistory_future=()
export dirhistory_past
export dirhistory_future
@@ -50,7 +50,7 @@ function push_future() {
# Called by zsh when directory changes
function chpwd() {
- push_past `pwd`
+ push_past $PWD
# If DIRHISTORY_CD is not set...
if [[ -z "${DIRHISTORY_CD+x}" ]]; then
# ... clear future.
@@ -73,7 +73,7 @@ function dirhistory_back() {
pop_past cw
if [[ "" == "$cw" ]]; then
# Someone overwrote our variable. Recover it.
- dirhistory_past=(`pwd`)
+ dirhistory_past=($PWD)
return
fi
diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
index 9d898edca..2e9ce1c52 100644
--- a/plugins/django/django.plugin.zsh
+++ b/plugins/django/django.plugin.zsh
@@ -141,6 +141,7 @@ _managepy-sqlinitialdata(){}
_managepy-sqlreset(){}
_managepy-sqlsequencereset(){}
_managepy-startapp(){}
+_managepy-startproject(){}
_managepy-syncdb() {
_arguments -s : \
@@ -198,6 +199,7 @@ _managepy-commands() {
'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
"startapp:Creates a Django app directory structure for the given app name in this project's directory."
+ "startproject:Creates a Django project directory structure for the given project name in this current directory."
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
'testserver:Runs a development server with data from the given fixture(s).'
@@ -234,5 +236,6 @@ _managepy() {
compdef _managepy manage.py
compdef _managepy django
+compdef _managepy django-admin
compdef _managepy django-admin.py
compdef _managepy django-manage
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index c291037a3..aadc9c61d 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -4,13 +4,14 @@
# Requires: Docker installed
# Author: Azaan (@aeonazaan)
# Updates: Bob Maerten (@bobmaerten) for Docker v0.9+
+# Paul van den Berg (@bergvandenp) for Docker v1.3+
# ----- Helper functions
# Output a selectable list of all running docker containers
__docker_containers() {
declare -a cont_cmd
- cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
+ cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
_describe 'containers' cont_cmd
}
@@ -214,7 +215,11 @@ __save() {
__start() {
_arguments \
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
- '(-i,--interactive=)'{-i, --interactive=}'[Attach container''s stdin]'
+ '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
+ __docker_containers
+}
+
+__stats() {
__docker_containers
}
@@ -238,6 +243,14 @@ __wait() {
__docker_containers
}
+__exec() {
+ _arguments \
+ '(-d,--detach=)'{-d,--detach=}'[Detached mode: run command in the background]' \
+ '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
+ '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-TTY]'
+ __docker_containers
+}
+
# end commands ---------
# ----------------------
@@ -271,11 +284,13 @@ _1st_arguments=(
"save":"Save an image to a tar archive"
"search":"Search for an image in the docker index"
"start":"Start a stopped container"
+ "stats":"Display a live stream of one or more containers' resource usage statistics"
"stop":"Stop a running container"
"tag":"Tag an image into a repository"
"top":"Lookup the running processes of a container"
"version":"Show the docker version information"
"wait":"Block until a container stops, then print its exit code"
+ "exec":"Run a task inside a running container"
)
_arguments '*:: :->command'
@@ -341,6 +356,8 @@ case "$words[1]" in
__save ;;
search)
__search ;;
+ stats)
+ __stats ;;
start)
__start ;;
stop)
@@ -353,4 +370,6 @@ case "$words[1]" in
__version ;;
wait)
__wait ;;
+ exec)
+ __exec ;;
esac
diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md
new file mode 100644
index 000000000..d1dedf884
--- /dev/null
+++ b/plugins/ember-cli/README.md
@@ -0,0 +1,22 @@
+# Ember-cli
+
+**Maintainer:** [BilalBudhani](http://www.github.com/BilalBudhani)
+
+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 eia='ember install:addon'
+alias eib='ember install:bower'
+alias ein='ember install:npm'
+alias ei='ember install'
+alias et='ember test'
+alias eu='ember update'
+alias ev='ember version'
diff --git a/plugins/ember-cli/ember-cli.plugin.zsh b/plugins/ember-cli/ember-cli.plugin.zsh
new file mode 100644
index 000000000..044a2c043
--- /dev/null
+++ b/plugins/ember-cli/ember-cli.plugin.zsh
@@ -0,0 +1,19 @@
+# Ember ClI
+# visit http://www.ember-cli.com/ to view user guid
+
+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 eia='ember install:addon'
+alias eib='ember install:bower'
+alias ein='ember install:npm'
+alias ei='ember install'
+alias et='ember test'
+alias eu='ember update'
+
+# version
+alias ev='ember version'
diff --git a/plugins/emoji-clock/emoji-clock.plugin.zsh b/plugins/emoji-clock/emoji-clock.plugin.zsh
index 7351a02ec..0a55528f0 100644
--- a/plugins/emoji-clock/emoji-clock.plugin.zsh
+++ b/plugins/emoji-clock/emoji-clock.plugin.zsh
@@ -8,21 +8,25 @@
# -----------------------------------------------------------------------------
function emoji-clock() {
- hour=$(date '+%I')
- minutes=$(date '+%M')
+ # Add 15 minutes to the current time and save the value as $minutes.
+ (( minutes = $(date '+%M') + 15 ))
+ (( hour = $(date '+%I') + minutes / 60 ))
+ # make sure minutes and hours don't exceed 60 nor 12 respectively
+ (( minutes %= 60 )); (( hour %= 12 ))
+
case $hour in
- 01) clock="đź•"; [ $minutes -ge 30 ] && clock="đź•ś";;
- 02) clock="đź•‘"; [ $minutes -ge 30 ] && clock="đź•ť";;
- 03) clock="đź•’"; [ $minutes -ge 30 ] && clock="đź•ž";;
- 04) clock="đź•“"; [ $minutes -ge 30 ] && clock="đź•ź";;
- 05) clock="đź•”"; [ $minutes -ge 30 ] && clock="đź• ";;
- 06) clock="🕕"; [ $minutes -ge 30 ] && clock="🕡";;
- 07) clock="🕖"; [ $minutes -ge 30 ] && clock="🕢";;
- 08) clock="đź•—"; [ $minutes -ge 30 ] && clock="đź•Ł";;
- 09) clock="đź•"; [ $minutes -ge 30 ] && clock="🕤";;
+ 0) clock="🕛"; [ $minutes -ge 30 ] && clock="🕧";;
+ 1) clock="đź•"; [ $minutes -ge 30 ] && clock="đź•ś";;
+ 2) clock="đź•‘"; [ $minutes -ge 30 ] && clock="đź•ť";;
+ 3) clock="đź•’"; [ $minutes -ge 30 ] && clock="đź•ž";;
+ 4) clock="đź•“"; [ $minutes -ge 30 ] && clock="đź•ź";;
+ 5) clock="đź•”"; [ $minutes -ge 30 ] && clock="đź• ";;
+ 6) clock="🕕"; [ $minutes -ge 30 ] && clock="🕡";;
+ 7) clock="🕖"; [ $minutes -ge 30 ] && clock="🕢";;
+ 8) clock="đź•—"; [ $minutes -ge 30 ] && clock="đź•Ł";;
+ 9) clock="đź•"; [ $minutes -ge 30 ] && clock="🕤";;
10) clock="đź•™"; [ $minutes -ge 30 ] && clock="đź•Ą";;
11) clock="🕚"; [ $minutes -ge 30 ] && clock="🕦";;
- 12) clock="🕛"; [ $minutes -ge 30 ] && clock="🕧";;
*) clock="⌛";;
esac
echo $clock
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 7352e5bad..898d3d36e 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -38,7 +38,7 @@ function extract() {
file_name="$( basename "$1" )"
extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
case "$1" in
- (*.tar.gz|*.tgz) tar xvzf "$1" ;;
+ (*.tar.gz|*.tgz) [ -z $commands[pigz] ] && tar zxvf "$1" || pigz -dc "$1" | tar xv ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
&& tar --xz -xvf "$1" \
@@ -47,12 +47,12 @@ function extract() {
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
- (*.gz) gunzip "$1" ;;
+ (*.gz) [ -z $commands[pigz] ] && gunzip "$1" || pigz -d "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
- (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;;
+ (*.zip|*.war|*.jar|*.sublime-package) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh
index b0e60a434..692ca5790 100644
--- a/plugins/forklift/forklift.plugin.zsh
+++ b/plugins/forklift/forklift.plugin.zsh
@@ -1,4 +1,4 @@
-# Open folder in ForkLift.app of ForkLift2.app from console
+# Open folder in ForkLift.app or ForkLift2.app from console
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift2 by Johan Kaving
#
diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
new file mode 100644
index 000000000..32784d03b
--- /dev/null
+++ b/plugins/frontend-search/README.md
@@ -0,0 +1,82 @@
+## Rationale ##
+
+The idea for this script is to help searches in important doc contents from frontend.
+
+## Instalation ##
+
+I will send a Pull Request with this plugin for .oh-my-zsh official repository. If accept them, it's only add in plugins list that exists in ```.zshrc``` file.
+
+For now, you can clone this repository and add in ```custom/plugins``` folder
+
+```bash
+$ git clone git://github.com/willmendesneto/frontend-search.git ~/.oh-my-zsh/custom/plugins/frontend-search
+```
+
+After this, restart your terminal and frontend-search plugin is configurated in you CLI.
+
+```bash
+...
+plugins=( <your-plugins-list>... frontend-search)
+...
+```
+
+## Commands ##
+
+All command searches are accept only in format
+
+* `frontend <search-content> <search-term>`
+
+The search content are
+
+* `jquery <api.jquery.com>`
+* `mdn <developer.mozilla.org>`
+* `compass <compass-style.org>`
+* `html5please <html5please.com>`
+* `caniuse <caniuse.com>`
+* `aurajs <aurajs.com>`
+* `dartlang <api.dartlang.org/apidocs/channels/stable/dartdoc-viewer>`
+* `lodash <search>`
+* `qunit <api.qunitjs.com>`
+* `fontello <fontello.com>`
+* `bootsnipp <bootsnipp.com>`
+* `cssflow <cssflow.com>`
+* `codepen <codepen.io>`
+* `unheap <www.unheap.com>`
+* `bem <google.com/search?as_q=<search-term>&as_sitesearch=bem.info>`
+* `smacss <google.com/search?as_q=<search-term>&as_sitesearch=smacss.com>`
+* `angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>`
+* `reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
+* `emberjs <emberjs.com>`
+
+
+## Aliases ##
+
+There are a few aliases presented as well:
+
+* `jquery` A shorthand for `frontend jquery`
+* `mdn` A shorthand for `frontend mdn`
+* `compass` A shorthand for `frontend compass`
+* `html5please` A shorthand for `frontend html5please`
+* `caniuse` A shorthand for `frontend caniuse`
+* `aurajs` A shorthand for `frontend aurajs`
+* `dartlang` A shorthand for `frontend dartlang`
+* `lodash` A shorthand for `frontend lodash`
+* `qunit` A shorthand for `frontend qunit`
+* `fontello` A shorthand for `frontend fontello`
+* `bootsnipp` A shorthand for `frontend bootsnipp`
+* `cssflow` A shorthand for `frontend cssflow`
+* `codepen` A shorthand for `frontend codepen`
+* `unheap` A shorthand for `frontend unheap`
+* `bem` A shorthand for `frontend bem`
+* `smacss` A shorthand for `frontend smacss`
+* `angularjs` A shorthand for `frontend angularjs`
+* `reactjs` A shorthand for `frontend reactjs`
+* `emberjs` A shorthand for `frontend emberjs`
+
+## Author
+
+**Wilson Mendes (willmendesneto)**
++ <https://twitter.com/willmendesneto>
++ <http://github.com/willmendesneto>
+
+New features comming soon.
diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
new file mode 100644
index 000000000..f1d45b0d1
--- /dev/null
+++ b/plugins/frontend-search/frontend-search.plugin.zsh
@@ -0,0 +1,151 @@
+# frontend from terminal
+
+function frontend() {
+
+ # get the open command
+ local open_cmd
+ if [[ $(uname -s) == 'Darwin' ]]; then
+ open_cmd='open'
+ else
+ open_cmd='xdg-open'
+ fi
+
+ # no keyword provided, simply show how call methods
+ if [[ $# -le 1 ]]; then
+ echo "Please provide a search-content and a search-term for app.\nEx:\nfrontend <search-content> <search-term>\n"
+ return 1
+ fi
+
+ # check whether the search engine is supported
+ if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs)' ]];
+ then
+ echo "Search valid search content $1 not supported."
+ echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
+ echo "* jquery"
+ echo "* mdn"
+ echo "* compass"
+ echo "* html5please"
+ echo "* caniuse"
+ echo "* aurajs"
+ echo "* dartlang"
+ echo "* lodash"
+ echo "* qunit"
+ echo "* fontello"
+ echo "* bootsnipp"
+ echo "* cssflow"
+ echo "* codepen"
+ echo "* unheap"
+ echo "* bem"
+ echo "* smacss"
+ echo "* angularjs"
+ echo "* reactjs"
+ echo "* emberjs"
+ echo ""
+
+ return 1
+ fi
+
+ local url="http://"
+ local query=""
+
+ case "$1" in
+ "jquery")
+ url="${url}api.jquery.com"
+ url="${url}/?s=$2" ;;
+ "mdn")
+ url="${url}developer.mozilla.org"
+ url="${url}/search?q=$2" ;;
+ "compass")
+ url="${url}compass-style.org"
+ url="${url}/search?q=$2" ;;
+ "html5please")
+ url="${url}html5please.com"
+ url="${url}/#$2" ;;
+ "caniuse")
+ url="${url}caniuse.com"
+ url="${url}/#search=$2" ;;
+ "aurajs")
+ url="${url}aurajs.com"
+ url="${url}/api/#stq=$2" ;;
+ "dartlang")
+ url="${url}api.dartlang.org/apidocs/channels/stable/dartdoc-viewer"
+ url="${url}/dart-$2" ;;
+ "qunit")
+ url="${url}api.qunitjs.com"
+ url="${url}/?s=$2" ;;
+ "fontello")
+ url="${url}fontello.com"
+ url="${url}/#search=$2" ;;
+ "bootsnipp")
+ url="${url}bootsnipp.com"
+ url="${url}/search?q=$2" ;;
+ "cssflow")
+ url="${url}cssflow.com"
+ url="${url}/search?q=$2" ;;
+ "codepen")
+ url="${url}codepen.io"
+ url="${url}/search?q=$2" ;;
+ "unheap")
+ url="${url}www.unheap.com"
+ url="${url}/?s=$2" ;;
+ "bem")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=bem.info" ;;
+ "smacss")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=smacss.com" ;;
+ "angularjs")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=angularjs.org" ;;
+ "reactjs")
+ url="${url}google.com"
+ url="${url}/search?as_q=$2&as_sitesearch=facebook.github.io/react" ;;
+ "emberjs")
+ url="${url}emberjs.com"
+ url="${url}/api/#stq=$2&stp=1" ;;
+ *) echo "INVALID PARAM!"
+ return ;;
+ esac
+
+ echo "$url"
+
+ $open_cmd "$url"
+
+}
+
+# javascript
+alias jquery='frontend jquery'
+alias mdn='frontend mdn'
+
+# pre processors frameworks
+alias compassdoc='frontend compass'
+
+# important links
+alias html5please='frontend html5please'
+alias caniuse='frontend caniuse'
+
+# components and libraries
+alias aurajs='frontend aurajs'
+alias dartlang='frontend dartlang'
+alias lodash='frontend lodash'
+
+#tests
+alias qunit='frontend qunit'
+
+#fonts
+alias fontello='frontend fontello'
+
+# snippets
+alias bootsnipp='frontend bootsnipp'
+alias cssflow='frontend cssflow'
+alias codepen='frontend codepen'
+alias unheap='frontend unheap'
+
+# css architecture
+alias bem='frontend bem'
+alias smacss='frontend smacss'
+
+# frameworks
+alias angularjs='frontend angularjs'
+alias reactjs='frontend reactjs'
+alias emberjs='frontend emberjs'
diff --git a/plugins/gem/_gem b/plugins/gem/_gem
index 25967f1e7..92feebe95 100644
--- a/plugins/gem/_gem
+++ b/plugins/gem/_gem
@@ -59,6 +59,8 @@ case "$words[1]" in
build)
_files -g "*.gemspec"
;;
+ install)
+ _files ;;
list)
if [[ "$state" == forms ]]; then
_gem_installed
diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
index b9ea06844..4357c0895 100644
--- a/plugins/git-flow/git-flow.plugin.zsh
+++ b/plugins/git-flow/git-flow.plugin.zsh
@@ -5,7 +5,7 @@
#
# To achieve git-flow completion nirvana:
#
-# 0. Update your zsh's git-completion module to the newest verion.
+# 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
#
# 1. Install this file. Either:
@@ -17,7 +17,7 @@
#
# source ~/.git-flow-completion.zsh
#
-# c. Or, use this file as a oh-my-zsh plugin.
+# c. Or, use this file as an oh-my-zsh plugin.
#
#Alias
diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh
index a09f88391..4cf5b9177 100644
--- a/plugins/git-hubflow/git-hubflow.plugin.zsh
+++ b/plugins/git-hubflow/git-hubflow.plugin.zsh
@@ -5,7 +5,7 @@
#
# To achieve git-hubflow completion nirvana:
#
-# 0. Update your zsh's git-completion module to the newest verion.
+# 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
#
# 1. Install this file. Either:
@@ -17,7 +17,7 @@
#
# source ~/.git-hubflow-completion.zsh
#
-# c. Or, use this file as a oh-my-zsh plugin.
+# c. Or, use this file as an oh-my-zsh plugin.
#
_git-hf ()
diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh
index 01b8a88d9..d868a5fe1 100644
--- a/plugins/git-prompt/git-prompt.plugin.zsh
+++ b/plugins/git-prompt/git-prompt.plugin.zsh
@@ -2,9 +2,6 @@
# http://github.com/olivierverdier/zsh-git-prompt
#
export __GIT_PROMPT_DIR=$ZSH/plugins/git-prompt
-# Initialize colors.
-autoload -U colors
-colors
# Allow for functions in the prompt.
setopt PROMPT_SUBST
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index c579d1e82..9da448814 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -7,6 +7,8 @@ alias gd='git diff'
compdef _git gd=git-diff
alias gdc='git diff --cached'
compdef _git gdc=git-diff
+alias gdt='git diff-tree --no-commit-id --name-only -r'
+compdef _git gdc=git diff-tree --no-commit-id --name-only -r
alias gl='git pull'
compdef _git gl=git-pull
alias gup='git pull --rebase'
@@ -16,6 +18,7 @@ compdef _git gp=git-push
alias gd='git diff'
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
+alias gdt='git difftool'
alias gc='git commit -v'
compdef _git gc=git-commit
alias gc!='git commit -v --amend'
@@ -51,6 +54,7 @@ alias gb='git branch'
compdef _git gb=git-branch
alias gba='git branch -a'
compdef _git gba=git-branch
+alias gbr='git branch --remote'
alias gcount='git shortlog -sn'
compdef gcount=git
alias gcl='git config --list'
@@ -70,6 +74,8 @@ alias gss='git status -s'
compdef _git gss=git-status
alias ga='git add'
compdef _git ga=git-add
+alias gap='git add --patch'
+alias gaa='git add --all'
alias gm='git merge'
compdef _git gm=git-merge
alias grh='git reset HEAD'
@@ -77,6 +83,18 @@ alias grhh='git reset HEAD --hard'
alias gclean='git reset --hard && git clean -dfx'
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
+# Sign and verify commits with GPG
+alias gcs='git commit -S'
+compdef _git gcs=git-commit
+alias gsps='git show --pretty=short --show-signature'
+compdef _git gsps=git-show
+
+# Sign and verify tags with GPG
+alias gts='git tag -s'
+compdef _git gts=git-tag
+alias gvt='git verify-tag'
+compdef _git gvt=git verify-tag
+
#remove the gf alias
#alias gf='git ls-files | grep'
@@ -157,6 +175,3 @@ alias gignore='git update-index --assume-unchanged'
alias gunignore='git update-index --no-assume-unchanged'
# list temporarily ignored files
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
-
-
-
diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
index 25b1a1e1b..bd69b1bd5 100644
--- a/plugins/github/github.plugin.zsh
+++ b/plugins/github/github.plugin.zsh
@@ -40,7 +40,7 @@ fi
#
# Use this when creating a new repo from scratch.
empty_gh() { # [NAME_OF_REPO]
- repo = $1
+ repo=$1
ghuser=$( git config github.user )
mkdir "$repo"
diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh
index be037d87a..481d487ba 100644
--- a/plugins/gitignore/gitignore.plugin.zsh
+++ b/plugins/gitignore/gitignore.plugin.zsh
@@ -1,12 +1,12 @@
-function gi() { curl http://www.gitignore.io/api/$@ ;}
+function gi() { curl -sL https://www.gitignore.io/api/$@ ;}
-_gitignireio_get_command_list() {
- curl -s http://www.gitignore.io/api/list | tr "," "\n"
+_gitignoreio_get_command_list() {
+ curl -sL https://www.gitignore.io/api/list | tr "," "\n"
}
-_gitignireio () {
+_gitignoreio () {
compset -P '*,'
- compadd -S '' `_gitignireio_get_command_list`
+ compadd -S '' `_gitignoreio_get_command_list`
}
-compdef _gitignireio gi
+compdef _gitignoreio gi
diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
index 18bcaaff2..f2be6ca9c 100644
--- a/plugins/golang/golang.plugin.zsh
+++ b/plugins/golang/golang.plugin.zsh
@@ -158,3 +158,6 @@ __go_tool_complete() {
}
compdef __go_tool_complete go
+
+# aliases
+alias gfa='go fmt . ./...'
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index 9229512f7..97bf50b43 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -60,7 +60,7 @@ function in_gradle() {
############################################################################
_gradle_does_task_list_need_generating () {
[ ! -f .gradletasknamecache ] && return 0;
- [ .gradletasknamecache -nt build.gradle ] && return 0;
+ [ build.gradle -nt .gradletasknamecache ] && return 0;
return 1;
}
diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh
index 11777738c..11777738c 100755..100644
--- a/plugins/grails/grails.plugin.zsh
+++ b/plugins/grails/grails.plugin.zsh
diff --git a/plugins/grunt/grunt.plugin.zsh b/plugins/grunt/grunt.plugin.zsh
new file mode 100644
index 000000000..48f6cb5a2
--- /dev/null
+++ b/plugins/grunt/grunt.plugin.zsh
@@ -0,0 +1,253 @@
+#compdef grunt
+# -----------------------------------------------------------------------------
+# _grunt
+#
+# Completion script for grunt.
+# - https://github.com/gruntjs/grunt
+# - https://github.com/gruntjs/grunt-cli
+#
+# -----------------------------------------------------------------------------
+#
+# Version : 0.1.0
+# Author : Yonchu <yuyuchu3333@gmail.com>
+# License : MIT License
+# Repository : https://github.com/yonchu/grunt-zsh-completion
+# Last Change : 22 Jul 2013.
+#
+# Copyright (c) 2013 Yonchu.
+#
+# -----------------------------------------------------------------------------
+# USAGE
+# -----
+#
+# Enable caching:
+#
+# If you want to use the cache, set the followings in your .zshrc:
+#
+# zstyle ':completion:*' use-cache yes
+#
+#
+# Settings:
+#
+# - Show grunt file path:
+# zstyle ':completion::complete:grunt::options:' show_grunt_path yes
+#
+# - Cache expiration days (default: 7):
+# zstyle ':completion::complete:grunt::options:' expire 1
+#
+# - Not update options cache if target gruntfile is changed.
+# zstyle ':completion::complete:grunt::options:' no_update_options yes
+#
+# Note that if you change the zstyle settings,
+# you should delete the cache file and restart zsh.
+#
+# $ rm ~/.zcompcache/grunt
+# $ exec zsh
+#
+# -----------------------------------------------------------------------------
+
+function _grunt() {
+ local curcontext="$curcontext" update_policy state
+ local show_grunt_path update_msg gruntfile opts tasks
+
+ # Setup cache-policy.
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ if [[ -z $update_policy ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy __grunt_caching_policy
+ fi
+
+ # Check show_path option.
+ zstyle -b ":completion:${curcontext}:options:" show_grunt_path show_grunt_path
+
+ # Get current gruntfile.
+ gruntfile=$(__grunt_get_gruntfile)
+
+ # Initialize opts and tasks.
+ opts=()
+ tasks=()
+
+ # Add help options.
+ opts+=('(- 1 *)'{-h,--help}'[Display this help text.]')
+
+ ## Complete without gruntfile.
+ if [[ ! -f $gruntfile ]]; then
+ _arguments "${opts[@]}"
+ return
+ fi
+
+ ## Complete with gruntfile.
+ # Retrieve cache.
+ if ! __grunt_update_cache "$gruntfile"; then
+ update_msg=' (cache updated)'
+ fi
+
+ # Make optioins completion.
+ if [[ ${#__grunt_opts} -gt 0 ]]; then
+ opts+=("${__grunt_opts[@]}")
+ fi
+
+ # Complete arguments.
+ _arguments \
+ "${opts[@]}" \
+ '*: :->tasks' \
+ && return
+
+ case $state in
+ tasks)
+ if [[ $show_grunt_path == 'yes' ]]; then
+ update_msg="$update_msg: ${${gruntfile/#$HOME/~}%/}"
+ fi
+ # Make tasks completion.
+ if [[ ${#__grunt_tasks} -gt 0 ]]; then
+ tasks+=("${__grunt_tasks[@]}")
+ _describe -t grunt-task "$verbose grunt task$update_msg" tasks || return 1
+ fi
+ ;;
+ esac
+
+ return 0
+}
+
+# Cache policy:
+# The cache file name: grunt
+# The cache variable name: __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks
+function __grunt_update_cache() {
+ # TODO
+ local version='0.1.0'
+ local is_updating=0
+ local gruntfile="$1"
+ local grunt_info no_update_options cache_path
+
+ # Check no_update_options option.
+ zstyle -b ":completion:${curcontext}:options:" no_update_options no_update_options
+
+
+ if ! ( (( $+__grunt_gruntfile )) \
+ && (( $+__grunt_opts )) \
+ && (( $+__grunt_tasks )) ) \
+ && ! _retrieve_cache 'grunt'; then
+ is_updating=1
+ fi
+
+ if [[ $gruntfile != $__grunt_gruntfile ]]; then
+ # Except for --help options.
+ __grunt_gruntfile=$gruntfile
+ if [[ $no_update_options == 'yes' ]]; then
+ if [[ $PREFIX == ${PREFIX#-} ]]; then
+ # Not options completions.
+ is_updating=1
+ elif [[ ${#__grunt_opts} -lt 2 ]]; then
+ is_updating=1
+ else
+ unset __grunt_gruntfile
+ fi
+ else
+ is_updating=1
+ fi
+ else
+ if [[ $PREFIX != ${PREFIX#-} && ${#__grunt_opts} -gt 1 ]]; then
+ unset __grunt_gruntfile
+ fi
+ fi
+
+ if _cache_invalid 'grunt'; then
+ is_updating=1
+ fi
+
+ # Check _grunt version.
+ if [[ $__grunt_version != $version ]]; then
+ is_updating=1
+ fi
+
+ if [[ $is_updating -ne 0 ]]; then
+ # Update caceh.
+ __grunt_version=$version
+ __grunt_gruntfile=$gruntfile
+ is_updating=1
+ grunt_info=$(grunt --help --no-color --gruntfile "$__grunt_gruntfile" 2>/dev/null)
+ __grunt_opts=(${(f)"$(__grunt_get_opts "$grunt_info")"})
+ __grunt_tasks=(${(f)"$(__grunt_get_tasks "$grunt_info")"})
+ _store_cache 'grunt' __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks
+ fi
+ return $is_updating
+}
+
+function __grunt_get_tasks() {
+ echo -E "$1" \
+ | grep 'Available tasks' -A 100 \
+ | grep '^ ' \
+ | sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//' \
+ | sed -e 's/ /:/'
+}
+
+function __grunt_get_opts() {
+ local opt_hunk opt_sep opt_num line opt
+ opt_hunk=$(echo -E "$1" \
+ | grep 'Options$' -A 100 \
+ | sed '1 d' \
+ | sed -e 's/[[:blank:]]*$//' \
+ )
+
+ opt_sep=()
+ opt_hunk=(${(f)opt_hunk})
+ opt_num=0
+ for line in "$opt_hunk[@]"; do
+ opt=$(echo -E "$line" | sed -e 's/^[[:blank:]]*//')
+ if [[ $line == $opt ]]; then
+ break
+ fi
+ if [[ $opt != ${opt#-} ]]; then
+ # Start with -
+ (( opt_num++ ))
+ opt=$(echo -E "$opt" | sed 's/^\(\(--[^ ]*\)\(, \(-[^ ]*\)\)*\) */\2\\t\4\\\t/')
+ fi
+ opt_sep[$opt_num]=("${opt_sep[$opt_num]}${opt}")
+ done
+
+ for line in "$opt_sep[@]"; do
+ opt=(${(s:\t:)line})
+ if [[ ${opt[1]} == '--help' ]]; then
+ continue
+ fi
+ if [[ ${#opt} -eq 2 ]]; then
+ echo -E "(${opt[1]})${opt[1]}[${opt[2]}]"
+ else
+ echo -E "(${opt[1]},${opt[2]})${opt[1]}[${opt[3]}]"
+ echo -E "(${opt[1]},${opt[2]})${opt[2]}[${opt[3]}]"
+ fi
+ done
+}
+
+function __grunt_get_gruntfile() {
+ local gruntfile
+ local curpath="$PWD"
+ while [ "$curpath" ]; do
+ for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do
+ if [[ -e "$gruntfile" ]]; then
+ echo "$gruntfile"
+ return
+ fi
+ done
+ curpath=${curpath%/*}
+ done
+ return 1
+}
+
+function __grunt_caching_policy() {
+ # Returns status zero if the completions cache needs rebuilding.
+
+ # Rebuild if .agignore more recent than cache.
+ if [[ -f $__grunt_gruntfile && $__grunt_gruntfile -nt $1 ]]; then
+ # Invalid cache because gruntfile is old.
+ return 0
+ fi
+
+ local -a oldp
+ local expire
+ zstyle -s ":completion:${curcontext}:options:" expire expire || expire=7
+ # Rebuild if cache is more than $expire days.
+ oldp=( "$1"(Nm+$expire) )
+ (( $#oldp ))
+}
+
+compdef _grunt grunt
diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
index 46663303a..bb2f7403f 100644
--- a/plugins/heroku/_heroku
+++ b/plugins/heroku/_heroku
@@ -27,8 +27,6 @@ _1st_arguments=(
"config\:push":"push local config vars to heroku"
"config\:set":"set one or more config vars"
"config\:unset":"unset one or more config vars"
- "db\:push":"push local data up to your app"
- "db\:pull":"pull heroku data down into your local database"
"domains":"list custom domains for an app"
"domains\:add":"add a custom domain to an app"
"domains\:remove":"remove a custom domain from an app"
@@ -43,12 +41,20 @@ _1st_arguments=(
"logs\:drains":"manage syslog drains"
"maintenance\:on":"put the app into maintenance mode"
"maintenance\:off":"take the app out of maintenance mode"
+ "pg\:credentials":"display the DATABASE credentials"
+ "pg\:diagnose":"run diagnostics report on DATABASE"
"pg\:info":"display database information"
- "pg\:ingress":"allow direct connections to the database from this IP for one minute"
+ "pg\:kill":"kill a query"
+ "pg\:killall":"terminates ALL connections"
+ "pg\:maintenance":"manage maintenance for DATABASE"
"pg\:promote":"sets DATABASE as your DATABASE_URL"
+ "pg\:ps":"view active queries with execution time"
"pg\:psql":"open a psql shell to the database"
+ "pg\:pull":"pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE"
+ "pg\:push":"push from LOCAL_SOURCE_DATABASE to REMOTE_TARGET_DATABASE"
"pg\:reset":"delete all data in DATABASE"
"pg\:unfollow":"stop a replica from following and make it a read/write database"
+ "pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version"
"pg\:wait":"monitor database creation, exit when complete"
"pgbackups":"list captured backups"
"pgbackups\:url":"get a temporary URL for a backup"
@@ -108,26 +114,6 @@ case "$words[1]" in
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
)
;;
- db:push)
- _command_args=(
- '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
- '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
- '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
- '(-f|--filter)'{-f,--filter}'[only push certain tables]' \
- '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
- '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
- )
- ;;
- db:pull)
- _command_args=(
- '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
- '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
- '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
- '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
- '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
- '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
- )
- ;;
keys)
_command_args=(
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
diff --git a/plugins/history-substring-search/README b/plugins/history-substring-search/README
deleted file mode 100644
index be11adf76..000000000
--- a/plugins/history-substring-search/README
+++ /dev/null
@@ -1,7 +0,0 @@
-To activate this script, load it into an interactive ZSH session:
-
- % source history-substring-search.zsh
-
-See the "history-substring-search.zsh" file for more information:
-
- % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more
diff --git a/plugins/history-substring-search/README.markdown b/plugins/history-substring-search/README.markdown
new file mode 100644
index 000000000..143b813a1
--- /dev/null
+++ b/plugins/history-substring-search/README.markdown
@@ -0,0 +1,7 @@
+To activate this script, please include it the `plugins` variable within `~/.zshrc`
+
+ `plugins=(git history-substring-search.zsh)`
+
+See the "history-substring-search.zsh" file for more information:
+
+ `sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more`
diff --git a/plugins/jhbuild/README.md b/plugins/jhbuild/README.md
new file mode 100644
index 000000000..910526966
--- /dev/null
+++ b/plugins/jhbuild/README.md
@@ -0,0 +1,4 @@
+## JHBuild
+**Maintainer:** [Miguel Vaello](https://github.com/miguxbe)
+
+This plugin adds some jhbuild aliases and increase the completion function provided by zsh.
diff --git a/plugins/jhbuild/jhbuild.plugin.zsh b/plugins/jhbuild/jhbuild.plugin.zsh
new file mode 100644
index 000000000..fed1bc9fc
--- /dev/null
+++ b/plugins/jhbuild/jhbuild.plugin.zsh
@@ -0,0 +1,28 @@
+# Aliases
+#
+alias jh='jhbuild'
+# Build
+alias jhb='jhbuild build'
+alias jhbo='jhbuild buildone'
+# Checks
+alias jhckb='jhbuild checkbranches'
+alias jhckm='jhbuild checkmodulesets'
+# Info & list
+alias jhi='jhbuild info'
+alias jhl='jhbuild list'
+# Clean
+alias jhc='jhbuild clean'
+alias jhco='jhbuild cleanone'
+# Run
+alias jhr='jhbuild run'
+# Depends
+alias jhrd='jhbuild rdepends'
+alias jhsd='jhbuild sysdeps'
+# Update
+alias jhu='jhbuild update'
+alias jhuo='jhbuild updateone'
+# Uninstall
+alias jhun='jhbuild uninstall'
+
+
+
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index 739ee7142..4a36b882d 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -12,7 +12,7 @@
# jira ABC-123 # Opens an existing issue
open_jira_issue () {
local open_cmd
- if [[ $(uname -s) == 'Darwin' ]]; then
+ if [[ "$OSTYPE" = darwin* ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
@@ -26,20 +26,65 @@ open_jira_issue () {
jira_url=$JIRA_URL
else
echo "JIRA url is not specified anywhere."
- return 0
+ return 1
+ fi
+
+ if [ -f .jira-prefix ]; then
+ jira_prefix=$(cat .jira-prefix)
+ elif [ -f ~/.jira-prefix ]; then
+ jira_prefix=$(cat ~/.jira-prefix)
+ else
+ jira_prefix=""
fi
if [ -z "$1" ]; then
echo "Opening new issue"
- $open_cmd "$jira_url/secure/CreateIssue!default.jspa"
+ $open_cmd "${jira_url}/secure/CreateIssue!default.jspa"
+ elif [[ "$1" = "assigned" || "$1" = "reported" ]]; then
+ jira_query $@
else
echo "Opening issue #$1"
if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
- $open_cmd "$jira_url/issues/$1"
+ $open_cmd "$jira_url/issues/$jira_prefix$1"
else
- $open_cmd "$jira_url/browse/$1"
+ $open_cmd "$jira_url/browse/$jira_prefix$1"
fi
fi
}
+jira_name () {
+ if [[ -z "$1" ]]; then
+ if [[ "x${JIRA_NAME}" != "x" ]]; then
+ jira_name=${JIRA_NAME}
+ else
+ echo "JIRA_NAME not specified"
+ return 1
+ fi
+ else
+ jira_name=$@
+ fi
+}
+
+jira_query () {
+ verb="$1"
+ if [[ "${verb}" = "reported" ]]; then
+ lookup=reporter
+ preposition=by
+ elif [[ "${verb}" = "assigned" ]]; then
+ lookup=assignee
+ preposition=to
+ else
+ echo "not a valid lookup $verb"
+ return 1
+ fi
+ shift 1
+ jira_name $@
+ if [[ $? = 1 ]]; then
+ return 1
+ fi
+ echo "Browsing issues ${verb} ${preposition} ${jira_name}"
+ $open_cmd "${jira_url}/secure/IssueNavigator.jspa?reset=true&jqlQuery=${lookup}+%3D+%22${jira_name}%22+AND+resolution+%3D+unresolved+ORDER+BY+priority+DESC%2C+created+ASC"
+}
+
alias jira='open_jira_issue'
+
diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh
index bb7975b10..bb7975b10 100755..100644
--- a/plugins/jruby/jruby.plugin.zsh
+++ b/plugins/jruby/jruby.plugin.zsh
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index 5096879d8..d082c11e5 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -14,12 +14,12 @@ jump() {
mark() {
if (( $# == 0 )); then
- MARK=$(basename "$(pwd)")
+ MARK=$(basename "$PWD")
else
MARK="$1"
fi
- if read -q \?"Mark $(pwd) as ${MARK}? (y/n) "; then
- mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$MARK"
+ if read -q \?"Mark $PWD as ${MARK}? (y/n) "; then
+ mkdir -p "$MARKPATH"; ln -s "$PWD" "$MARKPATH/$MARK"
fi
}
@@ -27,7 +27,6 @@ unmark() {
rm -i "$MARKPATH/$1"
}
-autoload colors
marks() {
for link in $MARKPATH/*(@); do
local markname="$fg[cyan]${link:t}$reset_color"
@@ -39,7 +38,7 @@ marks() {
_completemarks() {
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
- reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
+ reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_a-zA-Z0-9\.\-]*):$/\2/g'))
else
if readlink -e "${MARKPATH}"/* &>/dev/null; then
reply=($(ls "${MARKPATH}"))
diff --git a/plugins/laravel4/laravel4.plugin.zsh b/plugins/laravel4/laravel4.plugin.zsh
index 4b1022b66..0edc84970 100644
--- a/plugins/laravel4/laravel4.plugin.zsh
+++ b/plugins/laravel4/laravel4.plugin.zsh
@@ -1,6 +1,6 @@
# Laravel4 basic command completion
_laravel4_get_command_list () {
- php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+ php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
}
_laravel4 () {
diff --git a/plugins/laravel5/laravel5.plugin.zsh b/plugins/laravel5/laravel5.plugin.zsh
new file mode 100644
index 000000000..2afa99317
--- /dev/null
+++ b/plugins/laravel5/laravel5.plugin.zsh
@@ -0,0 +1,20 @@
+# Laravel5 basic command completion
+_laravel5_get_command_list () {
+ php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
+}
+
+_laravel5 () {
+ if [ -f artisan ]; then
+ compadd `_laravel5_get_command_list`
+ fi
+}
+
+compdef _laravel5 artisan
+compdef _laravel5 la5
+
+#Alias
+alias la5='php artisan'
+
+alias la5dump='php artisan dump-autoload'
+alias la5cache='php artisan cache:clear'
+alias la5routes='php artisan routes'
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index bc36c80db..4fa6fcc34 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -4,8 +4,8 @@
# Flag indicating if we've previously jumped to last directory.
typeset -g ZSH_LAST_WORKING_DIRECTORY
-mkdir -p "$ZSH/cache"
-local cache_file="$ZSH/cache/last-working-dir"
+mkdir -p $ZSH_CACHE_DIR
+cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed.
function chpwd() {
diff --git a/plugins/marked2/README.md b/plugins/marked2/README.md
new file mode 100644
index 000000000..101343abb
--- /dev/null
+++ b/plugins/marked2/README.md
@@ -0,0 +1,13 @@
+## marked2
+
+Plugin for Marked 2, a previewer for Markdown files on Mac OS X
+
+### Requirements
+
+ * [Marked 2](http://marked2app.com)
+
+### Usage
+
+ * If `marked` is called without an argument, open Marked
+
+ * If `marked` is passed a file, open it in Marked
diff --git a/plugins/marked2/marked2.plugin.zsh b/plugins/marked2/marked2.plugin.zsh
new file mode 100644
index 000000000..56863ade5
--- /dev/null
+++ b/plugins/marked2/marked2.plugin.zsh
@@ -0,0 +1,12 @@
+#
+# If marked is called without an argument, open Marked
+# If marked is passed a file, open it in Marked
+#
+function marked() {
+ if [ "$1" ]
+ then
+ open -a "marked 2.app" "$1"
+ else
+ open -a "marked 2.app"
+ fi
+}
diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
index 2e99a12fb..86200ccf6 100644
--- a/plugins/mercurial/mercurial.plugin.zsh
+++ b/plugins/mercurial/mercurial.plugin.zsh
@@ -16,6 +16,8 @@ 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'
+# list unresolved files (since hg does not list unmerged files in the status command)
+alias hgun='hg resolve --list'
function in_hg() {
if [[ -d .hg ]] || $(hg summary > /dev/null 2>&1); then
@@ -33,14 +35,14 @@ function hg_prompt_info {
if [ $(in_hg) ]; then
_DISPLAY=$(hg_get_branch_name)
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\
-$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_PROMPT_BASE_COLOR"
+$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR"
unset _DISPLAY
fi
}
function hg_dirty_choose {
if [ $(in_hg) ]; then
- hg status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'
+ hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'
if [ $pipestatus[-1] -eq 0 ]; then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index 602f5ffa0..b7c982e0a 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -21,6 +21,7 @@ _1st_arguments=(
'local.install:Install a task or an archive locally'
'local.rebar:Install rebar locally'
'local.uninstall:Uninstall local tasks or archives'
+ 'local.hex:Install Hex locally'
'new:Creates a new Elixir project'
'run:Run the given file or expression'
"test:Run a project's tests"
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index ed7968534..865b15235 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -44,24 +44,29 @@ mvn-color()
# aliases
alias mvncie='mvn clean install eclipse:eclipse'
alias mvnci='mvn clean install'
+alias mvncist='mvn clean install -DskipTests'
alias mvne='mvn eclipse:eclipse'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnd='mvn deploy'
alias mvnp='mvn package'
alias mvnc='mvn clean'
alias mvncom='mvn compile'
+alias mvnct='mvn clean test'
alias mvnt='mvn test'
alias mvnag='mvn archetype:generate'
alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run'
-
+alias mvndt='mvn dependency:tree'
+alias mvns='mvn site'
+alias mvnsrc='mvn dependency:sources'
+alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
function listMavenCompletions {
reply=(
# common lifecycle
- clean process-resources compile process-test-resources test-compile test package verify install deploy site
+ clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
# common plugins
deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
@@ -126,6 +131,10 @@ function listMavenCompletions {
tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
# tomcat7
tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
+ # tomee
+ tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
+ # spring-boot
+ spring-boot:run spring-boot:repackage
# exec
exec:exec exec:java
# versions
diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
index 2d78f2b4c..39d8b10d9 100644
--- a/plugins/node/node.plugin.zsh
+++ b/plugins/node/node.plugin.zsh
@@ -3,7 +3,7 @@
function node-docs {
# get the open command
local open_cmd
- if [[ $(uname -s) == 'Darwin' ]]; then
+ if [[ "$OSTYPE" = darwin* ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index c3eb91d31..d19079b3f 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -1 +1,7 @@
eval "$(npm completion 2>/dev/null)"
+
+# Install and save to dependencies
+alias npms="npm i -S "
+
+# Install and save to dev-dependencies
+alias npmd="npm i -D "
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 63760b5ff..d0f9f009a 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -35,6 +35,7 @@ EOF
set current_session to current session
tell current_session
write text "${command}"
+ keystroke return
end tell
end tell
end tell
@@ -139,7 +140,7 @@ function man-preview() {
function trash() {
local trash_dir="${HOME}/.Trash"
- local temp_ifs=$IFS
+ local temp_ifs="$IFS"
IFS=$'\n'
for item in "$@"; do
if [[ -e "$item" ]]; then
@@ -174,12 +175,47 @@ function itunes() {
next|previous)
opt="$opt track"
;;
+ vol)
+ opt="set sound volume to $1" #$1 Due to the shift
+ ;;
+ shuf|shuff|shuffle)
+ # The shuffle property of current playlist can't be changed in iTunes 12,
+ # so this workaround uses AppleScript to simulate user input instead.
+ # Defaults to toggling when no options are given.
+ # The toggle option depends on the shuffle button being visible in the Now playing area.
+ # On and off use the menu bar items.
+ local state=$1
+
+ if [[ -n "$state" && ! "$state" =~ "^(on|off|toggle)$" ]]
+ then
+ print "Usage: itunes shuffle [on|off|toggle]. Invalid option."
+ return 1
+ fi
+
+ case "$state" in
+ on|off)
+ # Inspired by: http://stackoverflow.com/a/14675583
+ osascript 1>/dev/null 2>&1 <<-EOF
+ tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" )
+EOF
+ return 0
+ ;;
+ toggle|*)
+ osascript 1>/dev/null 2>&1 <<-EOF
+ tell application "System Events" to perform action "AXPress" of (button 2 of process "iTunes"'s window "iTunes"'s scroll area 1)
+EOF
+ return 0
+ ;;
+ esac
+ ;;
""|-h|--help)
echo "Usage: itunes <option>"
echo "option:"
echo "\tlaunch|play|pause|stop|rewind|resume|quit"
echo "\tmute|unmute\tcontrol volume set"
echo "\tnext|previous\tplay next or previous track"
+ echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
+ echo "\tvol\tSet the volume, takes an argument from 0 to 100"
echo "\thelp\tshow this message and exit"
return 0
;;
@@ -190,4 +226,3 @@ function itunes() {
esac
osascript -e "tell application \"iTunes\" to $opt"
}
-
diff --git a/plugins/pass/_pass b/plugins/pass/_pass
index d8ec38828..7a9b1f955 100644
--- a/plugins/pass/_pass
+++ b/plugins/pass/_pass
@@ -1,13 +1,16 @@
#compdef pass
#autoload
-# Copyright (C) 2012:
+# Copyright (C) 2012 - 2014:
# Johan Venant <jvenant@invicem.pro>
# Brian Mattern <rephorm@rephorm.com>
# Jason A. Donenfeld <Jason@zx2c4.com>.
-# Santiago Borrazás <sanbor@gmail.com>
# All Rights Reserved.
-# This file is licensed under the GPLv2+. Please see COPYING for more information.
+#
+# This file is licensed under the GPLv2+.
+# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information.
+#
+# Oh my zsh plugin maintainer: Santiago Borrazás <sanbor@gmail.com>
_pass () {
@@ -23,8 +26,8 @@ _pass () {
case "${cmd}" in
init)
_arguments : \
- "-r[re-encrypt existing passwords]" \
- "--reencrypt[re-encrypt existing passwords]"
+ "-p[gpg-id will only be applied to this subfolder]" \
+ "--path[gpg-id will only be applied to this subfolder]"
_pass_complete_keys
;;
ls|list|edit)
@@ -43,9 +46,19 @@ _pass () {
"-n[don't include symbols in password]" \
"--no-symbols[don't include symbols in password]" \
"-c[copy password to the clipboard]" \
- "--clip[copy password to the clipboard]"
+ "--clip[copy password to the clipboard]" \
+ "-f[force overwrite]" \
+ "--force[force overwrite]" \
+ "-i[replace first line]" \
+ "--in-place[replace first line]"
_pass_complete_entries_with_subdirs
;;
+ cp|copy|mv|rename)
+ _arguments : \
+ "-f[force rename]" \
+ "--force[force rename]"
+ _pass_complete_entries_with_subdirs
+ ;;
rm)
_arguments : \
"-f[force deletion]" \
@@ -75,10 +88,14 @@ _pass () {
subcommands=(
"init:Initialize new password storage"
"ls:List passwords"
+ "find:Find password files or directories based on pattern"
+ "grep:Search inside decrypted password files for matching pattern"
"show:Decrypt and print a password"
"insert:Insert a new password"
"generate:Generate a new password using pwgen"
"edit:Edit a password with \$EDITOR"
+ "mv:Rename the password"
+ "cp:Copy the password"
"rm:Remove the password"
"git:Call git on the password store"
"version:Output version information"
@@ -101,7 +118,7 @@ _pass_cmd_show () {
_pass_complete_entries_helper () {
local IFS=$'\n'
local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
- _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
+ _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""}
}
_pass_complete_entries_with_subdirs () {
@@ -117,3 +134,5 @@ _pass_complete_keys () {
# Extract names and email addresses from gpg --list-keys
_values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')
}
+
+_pass
diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh
index f94c4195d..1fbf7c122 100644
--- a/plugins/perl/perl.plugin.zsh
+++ b/plugins/perl/perl.plugin.zsh
@@ -27,7 +27,7 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe
# Functions #################################################################
-# newpl - creates a basic Perl script file and opens it with $EDITOR
+# newpl - creates a basic Perl script file and opens it with $EDITOR
newpl () {
# set $EDITOR to 'vim' if it is undefined
[[ -z $EDITOR ]] && EDITOR=vim
@@ -54,9 +54,3 @@ pgs() { # [find] [replace] [filename]
prep() { # [pattern] [filename unless STDOUT]
perl -nle 'print if /'"$1"'/;' $2
}
-
-# say - append a newline to 'print'
-say() {
- print "$1\n"
-}
-
diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh
index 795f1db85..1f022047c 100644
--- a/plugins/phing/phing.plugin.zsh
+++ b/plugins/phing/phing.plugin.zsh
@@ -1,13 +1,13 @@
_phing_does_target_list_need_generating () {
[ ! -f .phing_targets ] && return 0;
- [ .phing_targets -nt build.xml ] && return 0;
+ [ build.xml -nt .phing_targets ] && return 0;
return 1;
}
_phing () {
if [ -f build.xml ]; then
if _phing_does_target_list_need_generating; then
- phing -l |grep -v ":$" |grep -v "^-*$" > .phing_targets
+ phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}' > .phing_targets
fi
compadd `cat .phing_targets`
fi
diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index 9892dd19c..cb155e5f4 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -1,4 +1,4 @@
-#compdef pip
+#compdef pip pip2 pip-2.7 pip3 pip-3.2 pip-3.3 pip-3.4
#autoload
# pip zsh completion, based on homebrew completion
diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh
index ba3765b83..1572e9363 100644
--- a/plugins/pj/pj.plugin.zsh
+++ b/plugins/pj/pj.plugin.zsh
@@ -18,8 +18,11 @@ function pj() {
file=$1
if [[ "open" == "$file" ]] then
- file=$2
+ shift
+ file=$*
cmd=(${(s: :)EDITOR})
+ else
+ file=$*
fi
for project in $PROJECT_PATHS; do
@@ -36,7 +39,11 @@ function pj() {
alias pjo="pj open"
function _pj () {
- compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'`
+ # might be possible to improve this using glob, without the basename trick
+ typeset -a projects
+ projects=($PROJECT_PATHS/*)
+ projects=$projects:t
+ _arguments "*:file:($projects)"
}
compdef _pj pj
diff --git a/plugins/postgres/postgres.plugin.zsh b/plugins/postgres/postgres.plugin.zsh
index cdd142e92..c2dbef244 100644
--- a/plugins/postgres/postgres.plugin.zsh
+++ b/plugins/postgres/postgres.plugin.zsh
@@ -1,6 +1,8 @@
-# Aliases to stop, start and restart Postgres
-# Paths noted below are for Postgress installed via Homebrew on OSX
+# Aliases to control Postgres
+# Paths noted below are for Postgres installed via Homebrew on OSX
alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
-alias restartpost='stoppost && sleep 1 && startpost' \ No newline at end of file
+alias restartpost='stoppost && sleep 1 && startpost'
+alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s'
+alias statuspost='pg_ctl status -D /usr/local/var/postgres -s' \ No newline at end of file
diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
index d85c88777..ded3336a7 100644
--- a/plugins/pow/pow.plugin.zsh
+++ b/plugins/pow/pow.plugin.zsh
@@ -21,13 +21,13 @@
rack_root(){
setopt chaselinks
- local orgdir="$(pwd)"
- local basedir="$(pwd)"
+ local orgdir="$PWD"
+ local basedir="$PWD"
while [[ $basedir != '/' ]]; do
test -e "$basedir/config.ru" && break
builtin cd ".." 2>/dev/null
- basedir="$(pwd)"
+ basedir="$PWD"
done
builtin cd "$orgdir" 2>/dev/null
@@ -56,7 +56,7 @@ kapow(){
compctl -W ~/.pow -/ kapow
powit(){
- local basedir="$(pwd)"
+ local basedir="$PWD"
local vhost=$1
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
if [ ! -h ~/.pow/$vhost ]
diff --git a/plugins/profiles/profiles.plugin.zsh b/plugins/profiles/profiles.plugin.zsh
index 8faae6b53..5bc56cea0 100644
--- a/plugins/profiles/profiles.plugin.zsh
+++ b/plugins/profiles/profiles.plugin.zsh
@@ -2,7 +2,7 @@
# This will look for a custom profile for the local machine and each domain or
# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
-parts=(${(s:.:)$(hostname)})
+parts=(${(s:.:)HOST})
for i in {${#parts}..1}; do
profile=${(j:.:)${parts[$i,${#parts}]}}
file=$ZSH_CUSTOM/profiles/$profile
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index fb46cdcf0..824658e44 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -6,7 +6,7 @@ function _rails_command () {
elif [ -e "script/server" ]; then
ruby script/$@
else
- rails $@
+ command rails $@
fi
}
@@ -14,7 +14,7 @@ function _rake_command () {
if [ -e "bin/rake" ]; then
bin/rake $@
else
- rake $@
+ command rake $@
fi
}
diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh
index cb84f69a1..cfc9a079f 100644
--- a/plugins/rake-fast/rake-fast.plugin.zsh
+++ b/plugins/rake-fast/rake-fast.plugin.zsh
@@ -10,7 +10,7 @@ _rake_refresh () {
_rake_does_task_list_need_generating () {
if [ ! -f .rake_tasks ]; then return 0;
else
- if [[ $(uname -s) == 'Darwin' ]]; then
+ if [[ "$OSTYPE" = darwin* ]]; then
accurate=$(stat -f%m .rake_tasks)
changed=$(stat -f%m Rakefile)
else
diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
index b6795b91c..213e1beb0 100644
--- a/plugins/rbenv/rbenv.plugin.zsh
+++ b/plugins/rbenv/rbenv.plugin.zsh
@@ -7,7 +7,7 @@ _rbenv-from-homebrew-installed() {
}
FOUND_RBENV=0
-rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
+rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv")
if _homebrew-installed && _rbenv-from-homebrew-installed ; then
rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
fi
diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh
index d690a9d22..33f4195c7 100644
--- a/plugins/repo/repo.plugin.zsh
+++ b/plugins/repo/repo.plugin.zsh
@@ -10,3 +10,9 @@ compdef _repo rs='repo sync'
alias rsrra='repo sync ; repo rebase --auto-stash'
compdef _repo rsrra='repo sync ; repo rebase --auto-stash'
+
+alias ru='repo upload'
+compdef _repo ru='repo upload'
+
+alias rst='repo status'
+compdef _repo rst='repo status'
diff --git a/plugins/rsync/rsync.plugin.zsh b/plugins/rsync/rsync.plugin.zsh
index 33a31a5c1..1a3bb4cc3 100644
--- a/plugins/rsync/rsync.plugin.zsh
+++ b/plugins/rsync/rsync.plugin.zsh
@@ -1,4 +1,4 @@
-alias rsync-copy="rsync -av --progress -h"
-alias rsync-move="rsync -av --progress -h --remove-source-files"
-alias rsync-update="rsync -avu --progress -h"
-alias rsync-synchronize="rsync -avu --delete --progress -h"
+alias rsync-copy="rsync -avz --progress -h"
+alias rsync-move="rsync -avz --progress -h --remove-source-files"
+alias rsync-update="rsync -avzu --progress -h"
+alias rsync-synchronize="rsync -avzu --delete --progress -h"
diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
index 3bde154df..234ac1642 100644
--- a/plugins/rvm/rvm.plugin.zsh
+++ b/plugins/rvm/rvm.plugin.zsh
@@ -6,6 +6,7 @@ alias gemsets='rvm gemset list'
local ruby18='ruby-1.8.7'
local ruby19='ruby-1.9.3'
local ruby20='ruby-2.0.0'
+local ruby21='ruby-2.1.2'
function rb18 {
if [ -z "$1" ]; then
@@ -40,6 +41,17 @@ function rb20 {
_rb20() {compadd `ls -1 $rvm_path/gems | grep "^$ruby20@" | sed -e "s/^$ruby20@//" | awk '{print $1}'`}
compdef _rb20 rb20
+function rb21 {
+ if [ -z "$1" ]; then
+ rvm use "$ruby21"
+ else
+ rvm use "$ruby21@$1"
+ fi
+}
+
+_rb21() {compadd `ls -1 $rvm_path/gems | grep "^$ruby21@" | sed -e "s/^$ruby21@//" | awk '{print $1}'`}
+compdef _rb21 rb21
+
function rvm-update {
rvm get head
}
diff --git a/plugins/scd/README.md b/plugins/scd/README.md
index 197cea50a..86ab67203 100644
--- a/plugins/scd/README.md
+++ b/plugins/scd/README.md
@@ -11,12 +11,9 @@ the index. A selection menu is displayed in case of several matches, with a
preference given to recently visited paths. `scd` can create permanent
directory aliases, which appear as named directories in zsh session.
-## INSTALLATION
+## INSTALLATION NOTES
-For oh-my-zsh, add `scd` to the `plugins` array in the ~/.zshrc file as in the
-[template file](../../templates/zshrc.zsh-template#L45).
-
-Besides zsh, `scd` can be used with *bash*, *dash* or *tcsh*
+Besides oh-my-zsh, `scd` can be used with *bash*, *dash* or *tcsh*
shells and is also available as [Vim](http://www.vim.org/) plugin and
[IPython](http://ipython.org/) extension. For installation details, see
https://github.com/pavoljuhas/smart-change-directory.
@@ -34,7 +31,7 @@ scd [options] [pattern1 pattern2 ...]
add specified directories to the directory index.</dd><dt>
--unindex</dt><dd>
- remove specified directories from the index.</dd><dt>
+ remove current or specified directories from the index.</dd><dt>
-r, --recursive</dt><dd>
apply options <em>--add</em> or <em>--unindex</em> recursively.</dd><dt>
@@ -47,6 +44,10 @@ scd [options] [pattern1 pattern2 ...]
remove ALIAS definition for the current or specified directory from
<em>~/.scdalias.zsh</em>.</dd><dt>
+-A, --all</dt><dd>
+ include all matching directories. Disregard matching by directory
+ alias and filtering of less likely paths.</dd><dt>
+
--list</dt><dd>
show matching directories and exit.</dd><dt>
@@ -70,7 +71,7 @@ scd doc
scd a b c
# Change to a directory path that ends with "ts"
-scd "ts(#e)"
+scd "ts$"
# Show selection menu and ranking of 20 most likely directories
scd -v
diff --git a/plugins/scd/scd b/plugins/scd/scd
index 1567d2736..39b28237d 100755
--- a/plugins/scd/scd
+++ b/plugins/scd/scd
@@ -11,20 +11,22 @@ fi
local DOC='scd -- smart change to a recently used directory
usage: scd [options] [pattern1 pattern2 ...]
Go to a directory path that contains all fixed string patterns. Prefer
-recently visited directories and directories with patterns in their tail
-component. Display a selection menu in case of multiple matches.
+recent or frequently visited directories as found in the directory index.
+Display a selection menu in case of multiple matches.
Options:
- -a, --add add specified directories to the directory index
- --unindex remove specified directories from the index
- -r, --recursive apply options --add or --unindex recursively
+ -a, --add add specified directories to the directory index.
+ --unindex remove current or specified directories from the index.
+ -r, --recursive apply options --add or --unindex recursively.
--alias=ALIAS create alias for the current or specified directory and
- store it in ~/.scdalias.zsh
+ store it in ~/.scdalias.zsh.
--unalias remove ALIAS definition for the current or specified
- directory from ~/.scdalias.zsh
- --list show matching directories and exit
- -v, --verbose display directory rank in the selection menu
- -h, --help display this message and exit
+ directory from ~/.scdalias.zsh.
+ -A, --all include all matching directories. Disregard matching by
+ directory alias and filtering of less likely paths.
+ --list show matching directories and exit.
+ -v, --verbose display directory rank in the selection menu.
+ -h, --help display this message and exit.
'
local SCD_HISTFILE=${SCD_HISTFILE:-${HOME}/.scdhistory}
@@ -35,9 +37,9 @@ local SCD_THRESHOLD=${SCD_THRESHOLD:-0.005}
local SCD_SCRIPT=${RUNNING_AS_COMMAND:+$SCD_SCRIPT}
local SCD_ALIAS=~/.scdalias.zsh
-local ICASE a d m p i tdir maxrank threshold
+local ICASE a d m p i maxrank threshold
local opt_help opt_add opt_unindex opt_recursive opt_verbose
-local opt_alias opt_unalias opt_list
+local opt_alias opt_unalias opt_all opt_list
local -A drank dalias
local dmatching
local last_directory
@@ -56,7 +58,8 @@ zmodload -i zsh/zutil
zmodload -i zsh/datetime
zparseopts -D -- a=opt_add -add=opt_add -unindex=opt_unindex \
r=opt_recursive -recursive=opt_recursive \
- -alias:=opt_alias -unalias=opt_unalias -list=opt_list \
+ -alias:=opt_alias -unalias=opt_unalias \
+ A=opt_all -all=opt_all -list=opt_list \
v=opt_verbose -verbose=opt_verbose h=opt_help -help=opt_help \
|| $EXIT $?
@@ -68,6 +71,11 @@ fi
# load directory aliases if they exist
[[ -r $SCD_ALIAS ]] && source $SCD_ALIAS
+# Private internal functions are prefixed with _scd_Y19oug_.
+# Clean them up when the scd function returns.
+setopt localtraps
+trap 'unfunction -m "_scd_Y19oug_*"' EXIT
+
# works faster than the (:a) modifier and is compatible with zsh 4.2.6
_scd_Y19oug_abspath() {
set -A $1 ${(ps:\0:)"$(
@@ -123,11 +131,52 @@ if [[ -n $opt_unalias ]]; then
$EXIT $?
fi
+# The "compress" function collapses repeated directories to
+# one entry with a time stamp that gives equivalent-probability.
+_scd_Y19oug_compress() {
+ awk -v epochseconds=$EPOCHSECONDS -v meanlife=$SCD_MEANLIFE '
+ BEGIN { FS = "[:;]"; }
+ length($0) < 4096 && $2 > 0 {
+ tau = 1.0 * ($2 - epochseconds) / meanlife;
+ if (tau < -6.9078) tau = -6.9078;
+ prob = exp(tau);
+ sub(/^[^;]*;/, "");
+ if (NF) {
+ dlist[last[$0]] = "";
+ dlist[NR] = $0;
+ last[$0] = NR;
+ ptot[$0] += prob;
+ }
+ }
+ END {
+ for (i = 1; i <= NR; ++i) {
+ d = dlist[i];
+ if (d) {
+ ts = log(ptot[d]) * meanlife + epochseconds;
+ printf(": %.0f:0;%s\n", ts, d);
+ }
+ }
+ }
+ ' $*
+}
+
# Rewrite directory index if it is at least 20% oversized
if [[ -s $SCD_HISTFILE ]] && \
(( $(wc -l <$SCD_HISTFILE) > 1.2 * $SCD_HISTSIZE )); then
- m=( ${(f)"$(<$SCD_HISTFILE)"} )
- print -lr -- ${m[-$SCD_HISTSIZE,-1]} >| ${SCD_HISTFILE}
+ # compress repeated entries
+ m=( ${(f)"$(_scd_Y19oug_compress $SCD_HISTFILE)"} )
+ # purge non-existent directories
+ m=( ${(f)"$(
+ for a in $m; do
+ if [[ -d ${a#*;} ]]; then print -r -- $a; fi
+ done
+ )"}
+ )
+ # cut old entries if still oversized
+ if [[ $#m -gt $SCD_HISTSIZE ]]; then
+ m=( ${m[-$SCD_HISTSIZE,-1]} )
+ fi
+ print -lr -- $m >| ${SCD_HISTFILE}
fi
# Determine the last recorded directory
@@ -135,7 +184,6 @@ if [[ -s ${SCD_HISTFILE} ]]; then
last_directory=${"$(tail -1 ${SCD_HISTFILE})"#*;}
fi
-# Internal functions are prefixed with "_scd_Y19oug_".
# The "record" function adds its arguments to the directory index.
_scd_Y19oug_record() {
while [[ -n $last_directory && $1 == $last_directory ]]; do
@@ -217,7 +265,7 @@ _scd_Y19oug_action() {
# set global arrays dmatching and drank
_scd_Y19oug_match() {
## single argument that is an existing directory or directory alias
- if [[ $# == 1 ]] && \
+ if [[ -z $opt_all && $# == 1 ]] && \
[[ -d ${d::=$1} || -d ${d::=${nameddirs[$1]}} ]] && [[ -x $d ]];
then
_scd_Y19oug_abspath dmatching $d
@@ -227,6 +275,8 @@ _scd_Y19oug_match() {
# ignore case unless there is an argument with an uppercase letter
[[ "$*" == *[[:upper:]]* ]] || ICASE='(#i)'
+ # support "$" as an anchor for the directory name ending
+ argv=( ${argv/(#m)?[$](#e)/${MATCH[1]}(#e)} )
# calculate rank of all directories in the SCD_HISTFILE and keep it as drank
# include a dummy entry for splitting of an empty string is buggy
@@ -237,10 +287,10 @@ _scd_Y19oug_match() {
BEGIN { FS = "[:;]"; }
length($0) < 4096 && $2 > 0 {
tau = 1.0 * ($2 - epochseconds) / meanlife;
- if (tau < -4.61) tau = -4.61;
- prec = exp(tau);
+ if (tau < -6.9078) tau = -6.9078;
+ prob = exp(tau);
sub(/^[^;]*;/, "");
- if (NF) ptot[$0] += prec;
+ if (NF) ptot[$0] += prob;
}
END { for (di in ptot) { print di; print ptot[di]; } }'
)"}
@@ -249,9 +299,12 @@ _scd_Y19oug_match() {
# filter drank to the entries that match all arguments
for a; do
- p=${ICASE}"*${a}*"
+ p=${ICASE}"*(${a})*"
drank=( ${(kv)drank[(I)${~p}]} )
done
+ # require at least one argument matches the directory name
+ p=${ICASE}"*(${(j:|:)argv})[^/]#"
+ drank=( ${(kv)drank[(I)${~p}]} )
# build a list of matching directories reverse-sorted by their probabilities
dmatching=( ${(f)"$(
@@ -261,26 +314,6 @@ _scd_Y19oug_match() {
)"}
)
- # if some directory paths match all patterns in order, discard all others
- p=${ICASE}"*${(j:*:)argv}*"
- m=( ${(M)dmatching:#${~p}} )
- [[ -d ${m[1]} ]] && dmatching=( $m )
- # if some directory names match last pattern, discard all others
- p=${ICASE}"*${(j:*:)argv}[^/]#"
- m=( ${(M)dmatching:#${~p}} )
- [[ -d ${m[1]} ]] && dmatching=( $m )
- # if some directory names match all patterns, discard all others
- m=( $dmatching )
- for a; do
- p=${ICASE}"*/[^/]#${a}[^/]#"
- m=( ${(M)m:#${~p}} )
- done
- [[ -d ${m[1]} ]] && dmatching=( $m )
- # if some directory names match all patterns in order, discard all others
- p=${ICASE}"/*${(j:[^/]#:)argv}[^/]#"
- m=( ${(M)dmatching:#${~p}} )
- [[ -d ${m[1]} ]] && dmatching=( $m )
-
# do not match $HOME or $PWD when run without arguments
if [[ $# == 0 ]]; then
dmatching=( ${dmatching:#(${HOME}|${PWD})} )
@@ -302,6 +335,9 @@ _scd_Y19oug_match() {
# discard all directories below the rank threshold
threshold=$(( maxrank * SCD_THRESHOLD ))
+ if [[ -n ${opt_all} ]]; then
+ threshold=0
+ fi
dmatching=( ${^dmatching}(Ne:'(( ${drank[$REPLY]} >= threshold ))':) )
}
@@ -339,6 +375,7 @@ fi
## here we have multiple matches - display selection menu
a=( {a-z} {A-Z} )
+a=( ${a[1,${#dmatching}]} )
p=( )
for i in {1..${#dmatching}}; do
[[ -n ${a[i]} ]] || break
diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
index 2fb8d5462..610ad34dc 100644
--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
@@ -1,7 +1,7 @@
#
# INSTRUCTIONS
#
-# To enabled agent forwarding support add the following to
+# To enable agent forwarding support add the following to
# your .zshrc file:
#
# zstyle :omz:plugins:ssh-agent agent-forwarding on
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index a2042343a..5acc75cc7 100755..100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -7,6 +7,7 @@ if [[ $('uname') == 'Linux' ]]; then
"/opt/sublime_text/sublime_text"
"/usr/bin/sublime_text"
"/usr/local/bin/sublime_text"
+ "/usr/bin/subl"
)
for _sublime_path in $_sublime_linux_paths; do
if [[ -a $_sublime_path ]]; then
@@ -16,7 +17,7 @@ if [[ $('uname') == 'Linux' ]]; then
fi
done
-elif [[ $('uname') == 'Darwin' ]]; then
+elif [[ "$OSTYPE" = darwin* ]]; then
local _sublime_darwin_paths > /dev/null 2>&1
_sublime_darwin_paths=(
"/usr/local/bin/subl"
diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
index d12e06853..e3ba39918 100644
--- a/plugins/sudo/sudo.plugin.zsh
+++ b/plugins/sudo/sudo.plugin.zsh
@@ -13,9 +13,8 @@
# ------------------------------------------------------------------------------
sudo-command-line() {
-[[ -z $BUFFER ]] && zle up-history
-[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER"
-zle end-of-line
+ [[ -z $BUFFER ]] && zle up-history
+ [[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index ea19bcea0..9ea7f641d 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -63,11 +63,11 @@ function svn_current_revision() {
function svn_status_info() {
local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
local svn_status="$(svn status 2> /dev/null)";
- if grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
- if grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DELETIONS:-âś–}"; fi
- if grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
- if grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-âż}"; fi
- if grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
- if grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DIRTY:-'!'}"; fi
+ if command grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
+ if command grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DELETIONS:-âś–}"; fi
+ if command grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
+ if command grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-âż}"; fi
+ if command grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
+ if command grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DIRTY:-'!'}"; fi
echo $svn_status_string
}
diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
index ef6da5bd3..9f7a4c6eb 100644
--- a/plugins/svn/svn.plugin.zsh
+++ b/plugins/svn/svn.plugin.zsh
@@ -61,7 +61,7 @@ function svn_get_rev_nr() {
function svn_dirty_choose() {
if in_svn; then
root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
- if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then
+ if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
else
@@ -77,8 +77,8 @@ function svn_dirty() {
function svn_dirty_choose_pwd () {
if in_svn; then
- root=`pwd`
- if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then
+ root=$PWD
+ if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
else
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
index 0d2bb68c3..e94280ed0 100644
--- a/plugins/symfony2/symfony2.plugin.zsh
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -1,21 +1,27 @@
# Symfony2 basic command completion
+_symfony_console () {
+ echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
+}
+
_symfony2_get_command_list () {
- php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
+ `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }'
}
_symfony2 () {
- if [ -f app/console ]; then
- compadd `_symfony2_get_command_list`
- fi
+ compadd `_symfony2_get_command_list`
}
-compdef _symfony2 app/console
+compdef _symfony2 '`_symfony_console`'
+compdef _symfony2 'app/console'
+compdef _symfony2 'bin/console'
compdef _symfony2 sf
#Alias
-alias sf='php app/console'
-alias sfcl='php app/console cache:clear'
-alias sfroute='php app/console router:debug'
-alias sfgb='php app/console generate:bundle'
-
+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 sfgb='sf generate:bundle'
diff --git a/plugins/systemadmin/systemadmin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
index f5e44c66f..4ae70dfa7 100644
--- a/plugins/systemadmin/systemadmin.zsh
+++ b/plugins/systemadmin/systemadmin.plugin.zsh
@@ -30,7 +30,7 @@ function retlog() {
}
alias ping='ping -c 5'
-alias clr='clear;echo "Currently logged in on $(tty), as $(whoami) in directory $(pwd)."'
+alias clr='clear;echo "Currently logged in on $(tty), as $USER in directory $PWD."'
alias path='echo -e ${PATH//:/\\n}'
alias mkdir='mkdir -pv'
# get top process eating memory
diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
index 0bda738bb..5cc253152 100644
--- a/plugins/taskwarrior/_task
+++ b/plugins/taskwarrior/_task
@@ -246,3 +246,5 @@ _task_default() {
return ret
}
+
+_task
diff --git a/plugins/textastic/README.md b/plugins/textastic/README.md
new file mode 100644
index 000000000..369c2c137
--- /dev/null
+++ b/plugins/textastic/README.md
@@ -0,0 +1,15 @@
+## textastic
+
+Plugin for Textastic, a text and code editor for Mac OS X
+
+### Requirements
+
+ * [Textastic](http://www.textasticapp.com/mac.html)
+
+### Usage
+
+ * If `tt` command is called without an argument, launch Textastic
+
+ * If `tt` is passed a directory, cd to it and open it in Textastic
+
+ * If `tt` is passed a file, open it in Textastic
diff --git a/plugins/textastic/textastic.plugin.zsh b/plugins/textastic/textastic.plugin.zsh
new file mode 100644
index 000000000..f5901eae2
--- /dev/null
+++ b/plugins/textastic/textastic.plugin.zsh
@@ -0,0 +1,17 @@
+#
+# If the tt command is called without an argument, launch Textastic
+# If tt is passed a directory, cd to it and open it in Textastic
+# If tt is passed a file, open it in Textastic
+#
+function tt() {
+ if [[ -z "$1" ]]
+ then
+ open -a "textastic.app"
+ else
+ open -a "textastic.app" "$1"
+ if [[ -d "$1" ]]
+ then
+ cd "$1"
+ fi
+ fi
+}
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index 626c41f3d..bc32c8907 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -5,6 +5,8 @@
alias ta='tmux attach -t'
alias ts='tmux new-session -s'
alias tl='tmux list-sessions'
+alias tksv='tmux kill-server'
+alias tkss='tmux kill-session -t'
# Only run if tmux is actually installed
if which tmux &> /dev/null
diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator
index cd227b7df..551267ed2 100644
--- a/plugins/tmuxinator/_tmuxinator
+++ b/plugins/tmuxinator/_tmuxinator
@@ -8,25 +8,29 @@ _arguments -C \
'1: :->cmds' \
'2:: :->args' && ret=0
+_configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
+
case $state in
cmds)
_values "tmuxinator command" \
+ "new[create a new project file and open it in your editor]" \
"start[start a tmux session using project's tmuxinator config]" \
"open[create a new project file and open it in your editor]" \
"copy[copy source_project project file to a new project called new_project]" \
"delete[deletes the project called project_name]" \
+ "debug[output the shell commands generated by a projet]" \
"implode[deletes all existing projects!]" \
"list[list all existing projects]" \
"doctor[look for problems in your configuration]" \
"help[shows this help document]" \
- "version[shows tmuxinator version number]"
+ "version[shows tmuxinator version number]" \
+ $_configs
ret=0
;;
args)
case $line[1] in
- start|open|copy|delete)
- _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`)
- _values 'configs' $_configs
+ start|open|copy|delete|debug)
+ [[ -n "$_configs" ]] && _values 'configs' $_configs
ret=0
;;
esac
diff --git a/plugins/ubuntu/readme.md b/plugins/ubuntu/readme.md
new file mode 100644
index 000000000..c9ef61f4e
--- /dev/null
+++ b/plugins/ubuntu/readme.md
@@ -0,0 +1,21 @@
+This plugin was created because the aliases in the debian plugin are inconsistent and hard to remember. Also this apt-priority detection that switched between apt-get and aptitude was dropped to keep it simpler. This plugin uses apt-get for everything but a few things that are only possible with aptitude I guess. Ubuntu does not have aptitude installed by default.
+
+acs = Apt-Cache Search
+acp = Apt-Cache Policy
+
+ag = sudo Apt-Get
+agi = sudo Apt-Get Install
+agd = sudo Apt-Get Dselect-upgrade
+By now you already can guess almost all aliases
+
+There are two exeptions since ...
+agu = sudo Apt-Get Update - we have ...
+agug = sudo Apt-Get UpGrade - as the exeptional 4 letter alias for a single command.
+
+afs = Apt-File Search --regexp - this has the regexp switch on without being represented in the alias, I guess this makes sense since the debian plugin has it, I never used that command.
+
+Then there are the 2 other 4 letter aliases for combined commands, that are straight forward and easy to remember.
+aguu = sudo Apt-Get Update && sudo apt-get Upgrade - better then adg or not?
+agud = sudo Apt-Get Update && sudo apt-get Dist-upgrade
+
+For a full list aliases and the functions just watch the plugins code https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/ubuntu/ubuntu.plugin.zsh, look at the comments if you want to switch from the debian plugin. Ubuntu, Mint and & co users will like the new aar function to install packages from ppas with a single command.
diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
new file mode 100644
index 000000000..0211d3374
--- /dev/null
+++ b/plugins/ubuntu/ubuntu.plugin.zsh
@@ -0,0 +1,141 @@
+# Authors:
+# https://github.com/AlexBio
+# https://github.com/dbb
+# https://github.com/Mappleconfusers
+# Nicolas Jonas nextgenthemes.com
+#
+# Debian, Ubuntu and friends related zsh aliases and functions for zsh
+
+alias acs='apt-cache search'
+compdef _acs acs='apt-cache search'
+
+alias afs='apt-file search --regexp'
+compdef _afs afs='apt-file search --regexp'
+
+# These are apt-get only
+alias ags='apt-get source' # asrc
+compdef _ags ags='apt-get source'
+
+alias acp='apt-cache policy' # app
+compdef _acp acp='apt-cache policy'
+
+# superuser operations ######################################################
+alias afu='sudo apt-file update'
+compdef _afu afu='sudo apt-file update'
+
+alias ppap='sudo ppa-purge'
+compdef _ppap ppap='sudo ppa-purge'
+
+alias ag='sudo apt-get' # age - but without sudo
+alias aga='sudo apt-get autoclean' # aac
+alias agb='sudo apt-get build-dep' # abd
+alias agc='sudo apt-get clean' # adc
+alias agd='sudo apt-get dselect-upgrade' # ads
+alias agi='sudo apt-get install' # ai
+alias agp='sudo apt-get purge' # ap
+alias agr='sudo apt-get remove' # ar
+alias agu='sudo apt-get update' # ad
+alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
+alias agug='sudo apt-get upgrade' # ag
+alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg
+
+compdef _ag ag='sudo apt-get'
+compdef _aga aga='sudo apt-get autoclean'
+compdef _agb agb='sudo apt-get build-dep'
+compdef _agc agc='sudo apt-get clean'
+compdef _agd agd='sudo apt-get dselect-upgrade'
+compdef _agi agi='sudo apt-get install'
+compdef _agp agp='sudo apt-get purge'
+compdef _agr agr='sudo apt-get remove'
+compdef _agu agu='sudo apt-get update'
+compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
+compdef _agug agug='sudo apt-get upgrade'
+compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
+
+# Remove ALL kernel images and headers EXCEPT the one in use
+alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
+ ?not(~n`uname -r`))'
+
+# Misc. #####################################################################
+# print all installed packages
+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
+
+# Create a basic .deb package
+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
+
+# apt-add-repository with automatic install/upgrade of the desired package
+# Usage: aar ppa:xxxxxx/xxxxxx [packagename]
+# If packagename is not given as 2nd arument the function will ask for it and guess the defaupt by taking
+# the part after the / from the ppa name wich is sometimes the right name for the package you want to install
+aar() {
+ if [ -n "$2" ]; then
+ PACKAGE=$2
+ else
+ read "PACKAGE?Type in the package name to install/upgrade with this ppa [${1##*/}]: "
+ fi
+
+ if [ -z "$PACKAGE" ]; then
+ PACKAGE=${1##*/}
+ fi
+
+ sudo apt-add-repository $1 && sudo apt-get update
+ sudo apt-get install $PACKAGE
+}
+
+# Prints apt history
+# Usage:
+# apt-history install
+# apt-history upgrade
+# apt-history remove
+# apt-history rollback
+# apt-history list
+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
+apt-history () {
+ case "$1" in
+ install)
+ zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
+ ;;
+ upgrade|remove)
+ zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
+ ;;
+ rollback)
+ zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
+ grep "$2" -A10000000 | \
+ grep "$3" -B10000000 | \
+ awk '{print $4"="$5}'
+ ;;
+ list)
+ zcat $(ls -rt /var/log/dpkg*)
+ ;;
+ *)
+ echo "Parameters:"
+ echo " install - Lists all packages that have been installed."
+ echo " upgrade - Lists all packages that have been upgraded."
+ echo " remove - Lists all packages that have been removed."
+ echo " rollback - Lists rollback information."
+ echo " list - Lists all contains of dpkg logs."
+ ;;
+ esac
+}
+
+# Kernel-package building shortcut
+kerndeb () {
+ # temporarily unset MAKEFLAGS ( '-j3' will fail )
+ MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
+ print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
+ appendage='-custom' # this shows up in $ (uname -r )
+ revision=$(date +"%Y%m%d") # this shows up in the .deb file name
+
+ make-kpkg clean
+
+ time fakeroot make-kpkg --append-to-version "$appendage" --revision \
+ "$revision" kernel_image kernel_headers
+}
+
+# List packages by size
+function apt-list-packages {
+ dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \
+ grep -v deinstall | \
+ sort -n | \
+ awk '{print $1" "$2}'
+}
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index d55ae6709..76f80b0d7 100644
--- a/plugins/vagrant/_vagrant
+++ b/plugins/vagrant/_vagrant
@@ -6,19 +6,26 @@
local -a _1st_arguments
_1st_arguments=(
'box:Box commands'
+ 'connect:Connects to a shared, remote Vagrant environment'
'destroy:Destroys the vagrant environment'
+ 'docker-logs:Shows Docker logs'
+ 'docker-run:Run one-off commands against a Docker container'
+ 'global-status:Reports the status of all active Vagrant environments on the system'
'halt:Halts the currently running vagrant environment'
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
+ 'login:Authenticates against a Vagrant Cloud server to access protected boxes'
'package:Packages a vagrant environment for distribution'
'plugin:Plugin commands'
'provision:Run the provisioner'
'reload:Reload the vagrant environment'
'resume:Resumes a suspend vagrant environment'
+ 'share:Shares the Vagrant environment and allows remote access'
'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.'
+ 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh'
+ 'status:Shows the status of the current Vagrant environment'
'suspend:Suspends the currently running vagrant environment'
'up:Creates the vagrant environment'
+ 'version:Prints the currently installed Vagrant version and checks for new updates'
'--help:[TASK] Describe available tasks or one specific task'
'--version:Prints the Vagrant version information'
)
@@ -49,7 +56,8 @@ __box_list ()
__vm_list ()
{
- _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
+ _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}')
+ _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null)
}
__vagrant-box ()
@@ -105,7 +113,7 @@ case $state in
(box)
__vagrant-box
;;
- (up|provision|package|destroy|reload|ssh|halt|resume|status)
+ (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status)
_arguments ':feature:__vm_list'
esac
;;
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
index 3ed32b3fb..4424bb29a 100644
--- a/plugins/vi-mode/vi-mode.plugin.zsh
+++ b/plugins/vi-mode/vi-mode.plugin.zsh
@@ -14,6 +14,11 @@ function zle-keymap-select zle-line-init zle-line-finish {
zle -R
}
+# Ensure that the prompt is redrawn when the terminal size changes.
+TRAPWINCH() {
+ zle && { zle reset-prompt; zle -R }
+}
+
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
@@ -26,6 +31,15 @@ bindkey -v
autoload -Uz edit-command-line
bindkey -M vicmd 'v' edit-command-line
+# allow ctrl-p, ctrl-n for navigate history (standard behaviour)
+bindkey '^P' up-history
+bindkey '^N' down-history
+
+# allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
+bindkey '^?' backward-delete-char
+bindkey '^h' backward-delete-char
+bindkey '^w' backward-kill-word
+
# if mode indicator wasn't setup by theme, define default
if [[ "$MODE_INDICATOR" == "" ]]; then
MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh
index 5142f1f9b..b0b9414cd 100644
--- a/plugins/vim-interaction/vim-interaction.plugin.zsh
+++ b/plugins/vim-interaction/vim-interaction.plugin.zsh
@@ -9,7 +9,7 @@ function resolveFile
if [ -f "$1" ]; then
echo $(readlink -f "$1")
elif [[ "${1#/}" == "$1" ]]; then
- echo "$(pwd)/$1"
+ echo "$PWD/$1"
else
echo $1
fi
diff --git a/plugins/virtualenv/virtualenv.plugin.zsh b/plugins/virtualenv/virtualenv.plugin.zsh
index 8e06450b1..e250eb63e 100644
--- a/plugins/virtualenv/virtualenv.plugin.zsh
+++ b/plugins/virtualenv/virtualenv.plugin.zsh
@@ -1,7 +1,6 @@
function virtualenv_prompt_info(){
- if [[ -n $VIRTUAL_ENV ]]; then
- printf "%s[%s] " "%{${fg[yellow]}%}" ${${VIRTUAL_ENV}:t}
- fi
+ [[ -n ${VIRTUAL_ENV} ]] || return
+ echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}"
}
# disables prompt mangling in virtual_env/bin/activate
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index f58bda1ad..5faa1a823 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -1,59 +1,70 @@
virtualenvwrapper='virtualenvwrapper.sh'
+
if (( $+commands[$virtualenvwrapper] )); then
source ${${virtualenvwrapper}:c}
+elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
+ virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper"
+ source "/etc/bash_completion.d/virtualenvwrapper"
+else
+ print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\
+ "Please install with \`pip install virtualenvwrapper\`" >&2
+ return
+fi
+if ! type workon &>/dev/null; then
+ print "zsh virtualenvwrapper plugin: shell function 'workon' not defined.\n"\
+ "Please check ${virtualenvwrapper}" >&2
+ return
+fi
- if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
- # Automatically activate Git projects's virtual environments based on the
- # directory name of the project. Virtual environment name can be overridden
- # by placing a .venv file in the project root with a virtualenv name in it
- function workon_cwd {
- if [ ! $WORKON_CWD ]; then
- WORKON_CWD=1
- # Check if this is a Git repo
- PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
- if (( $? != 0 )); then
- PROJECT_ROOT="."
- fi
- # Check for virtualenv name override
- if [[ -f "$PROJECT_ROOT/.venv" ]]; then
- ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
- elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then
- ENV_NAME="$PROJECT_ROOT/.venv"
- elif [[ "$PROJECT_ROOT" != "." ]]; then
- ENV_NAME=`basename "$PROJECT_ROOT"`
- else
- ENV_NAME=""
- fi
- if [[ "$ENV_NAME" != "" ]]; then
- # Activate the environment only if it is not already active
- if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
- if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
- workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
- elif [[ -e "$ENV_NAME/bin/activate" ]]; then
- source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
- fi
- fi
- elif [ $CD_VIRTUAL_ENV ]; then
- # We've just left the repo, deactivate the environment
- # Note: this only happens if the virtualenv was activated automatically
- deactivate && unset CD_VIRTUAL_ENV
- fi
- unset PROJECT_ROOT
- unset WORKON_CWD
- fi
- }
+if [[ "$WORKON_HOME" == "" ]]; then
+ print "\$WORKON_HOME is not defined so ZSH plugin virtualenvwrapper will not work" >&2
+ return
+fi
- # Append workon_cwd to the chpwd_functions array, so it will be called on cd
- # http://zsh.sourceforge.net/Doc/Release/Functions.html
- # TODO: replace with 'add-zsh-hook chpwd workon_cwd' when oh-my-zsh min version is raised above 4.3.4
- if (( ${+chpwd_functions} )); then
- if (( $chpwd_functions[(I)workon_cwd] == 0 )); then
- set -A chpwd_functions $chpwd_functions workon_cwd
+if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
+ # Automatically activate Git projects's virtual environments based on the
+ # directory name of the project. Virtual environment name can be overridden
+ # by placing a .venv file in the project root with a virtualenv name in it
+ function workon_cwd {
+ if [ ! $WORKON_CWD ]; then
+ WORKON_CWD=1
+ # Check if this is a Git repo
+ PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
+ if (( $? != 0 )); then
+ PROJECT_ROOT="."
+ fi
+ # Check for virtualenv name override
+ if [[ -f "$PROJECT_ROOT/.venv" ]]; then
+ ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
+ elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then
+ ENV_NAME="$PROJECT_ROOT/.venv"
+ elif [[ "$PROJECT_ROOT" != "." ]]; then
+ ENV_NAME=`basename "$PROJECT_ROOT"`
+ else
+ ENV_NAME=""
+ fi
+ if [[ "$ENV_NAME" != "" ]]; then
+ # Activate the environment only if it is not already active
+ if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
+ if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
+ workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
+ elif [[ -e "$ENV_NAME/bin/activate" ]]; then
+ source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
+ fi
fi
- else
- set -A chpwd_functions workon_cwd
+ elif [[ -n $CD_VIRTUAL_ENV && -n $VIRTUAL_ENV ]]; then
+ # We've just left the repo, deactivate the environment
+ # Note: this only happens if the virtualenv was activated automatically
+ deactivate && unset CD_VIRTUAL_ENV
+ fi
+ unset PROJECT_ROOT
+ unset WORKON_CWD
fi
+ }
+
+ # Append workon_cwd to the chpwd_functions array, so it will be called on cd
+ # http://zsh.sourceforge.net/Doc/Release/Functions.html
+ if ! (( $chpwd_functions[(I)workon_cwd] )); then
+ chpwd_functions+=(workon_cwd)
fi
-else
- print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}. Please install with \`pip install virtualenvwrapper\`."
fi
diff --git a/plugins/vundle/vundle.plugin.zsh b/plugins/vundle/vundle.plugin.zsh
index 936c8d7d2..830774fe3 100644
--- a/plugins/vundle/vundle.plugin.zsh
+++ b/plugins/vundle/vundle.plugin.zsh
@@ -4,7 +4,7 @@ function vundle-init () {
mkdir -p ~/.vim/bundle/vundle/
fi
- if [ ! -d ~/.vim/bundle/vundle/.git/ ]
+ if [ ! -d ~/.vim/bundle/vundle/.git ] && [ ! -f ~/.vim/bundle/vundle/.git ]
then
git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n"
diff --git a/plugins/wd/LICENSE b/plugins/wd/LICENSE
new file mode 100644
index 000000000..8caa6c6ce
--- /dev/null
+++ b/plugins/wd/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Markus Færevaag
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+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 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. \ No newline at end of file
diff --git a/plugins/wd/README.md b/plugins/wd/README.md
index f9f4e7ac1..ed149eb3e 100644
--- a/plugins/wd/README.md
+++ b/plugins/wd/README.md
@@ -1,38 +1,150 @@
-## wd
+wd
+==
+
+[![Build Status](https://travis-ci.org/mfaerevaag/wd.png?branch=master)](https://travis-ci.org/mfaerevaag/wd)
+
+`wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems ineffecient when the folder is frequently visited or has a long path.
+
+*NOTE*: If you are not using zsh, check out the `ruby` branch which has `wd` implemented as a gem.
+
+
+### Setup
+
+### oh-my-zsh
+
+`wd` comes bundles with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
+
+Just add the plugin in your `~/.zshrc` file:
+
+ plugins=(... wd)
+
+
+#### Automatic
+
+Run either in terminal:
+
+ * `curl -L https://github.com/mfaerevaag/wd/raw/master/install.sh | sh`
+
+ * `wget --no-check-certificate https://github.com/mfaerevaag/wd/raw/master/install.sh -O - | sh`
+
+
+#### Manual
+
+ * Clone this repo to your liking
+
+ * Add `wd` function to `.zshrc` (or `.profile` etc.):
+
+ wd() {
+ . ~/path/to/cloned/repo/wd/wd.sh
+ }
+
+ * Install manpage. From `wd`'s base directory (requires root permissions):
+
+ # cp wd.1 /usr/share/man/man1/wd.1
+ # chmod 644 /usr/share/man/man1/wd.1
+
+ Note, when pulling and updating `wd`, you'll need to do this again in case of changes to the manpage.
+
+
+#### Completion
+
+If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utelize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
+
+ fpath=(~/path/to/wd $fpath)
+
+Also, you may have to force a rebuild of `zcompdump` by running:
+
+ $ rm -f ~/.zcompdump; compinit
-**Maintainer:** [mfaerevaag](https://github.com/mfaerevaag)
-`wd` (warp directory) lets you jump to custom directories in zsh, without using cd. Why? Because cd seems ineffecient when the folder is frequently visited or has a long path. [Source](https://github.com/mfaerevaag/wd)
### Usage
* Add warp point to current working directory:
- wd add test
+ $ wd add foo
If a warp point with the same name exists, use `add!` to overwrite it.
- * From an other directory, warp to test with:
+ Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict other features, as below.
+
+ * From an other directory (not necessarily), warp to `foo` with:
- wd test
+ $ wd foo
- * You can warp back to previous directory, and so on, with the puncticulation syntax:
+ * You can warp back to previous directory, and so on, with this dot syntax:
- wd ..
- wd ...
+ $ wd ..
+ $ wd ...
This is a wrapper for the zsh `dirs` function.
+ (You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)).
* Remove warp point test point:
- wd rm test
+ $ wd rm foo
+
+ * List all warp points (stored in `~/.warprc`):
- * List warp points to current directory (stored in `~/.warprc`):
+ $ wd list
- wd show
+ * List files in given warp point:
- * List all warp points (stored in `~/.warprc`):
+ $ wd ls foo
+
+ * Show path of given warp point:
+
+ $ wd path foo
+
+ * List warp points to current directory, or optionally, path to given warp point:
+
+ $ wd show
+
+ * Remove warp points to non-existent directories.
+
+ $ wd clean
+
+ Use `clean!` to not be prompted with confirmation (force).
+
+ * Print usage with no opts or the `help` argument:
+
+ $ wd help
+
+ * Print the running version of `wd`:
+
+ $ wd --version
+
+ * Specifically set the config file (default `~/.warprc`), which is useful when testing:
+
+ $ wd --config ./file <action>
+
+ * Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required when testing/debugging.
+
+ $ wd --debug <action>
+
+ * Silence all output:
+
+ $ wd --quiet <action>
+
+
+### Testing
+
+`wd` comes with a small test suite, run with [shunit2](https://code.google.com/p/shunit2/). This can be used to confirm that things are working as it should on your setup, or to demonstrate an issue.
+
+To run, simply `cd` into the `test` directory and run the `tests.sh`.
+
+ $ ./tests.sh
+
+
+### License
+
+The project is licensed under the [MIT-license](https://github.com/mfaerevaag/wd/blob/master/LICENSE).
+
+
+### Finally
+
+If you have issues, feedback or improvements, don't hesitate to report it or submit a pull-request. In the case of an issue, we would much appreciate if you would include a failing test in `test/tests.sh`. Explanation on how to run the tests, read the section "Testing" in this README.
- wd ls
+Credit to [altschuler](https://github.com/altschuler) for awesome idea.
- * Print usage with no opts or the `help` argument.
+Hope you enjoy!
diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh
index 29df63520..b67f4a1e2 100644
--- a/plugins/wd/_wd.sh
+++ b/plugins/wd/_wd.sh
@@ -5,31 +5,28 @@ zstyle ':completion::complete:wd:*:commands' group-name commands
zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
zstyle ':completion::complete:wd::' list-grouped
-# Call `_wd()` when when trying to complete the command `wd`
-
zmodload zsh/mapfile
+
function _wd() {
- local ret=1
local CONFIG=$HOME/.warprc
-
- # Stolen from
- # http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
-
- # local curcontext="$curcontext" state line
- # typeset -A opt_args
+ local ret=1
local -a commands
local -a warp_points
- warp_points=( "${(f)mapfile[$CONFIG]}" )
- # LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it
+
+ warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
commands=(
'add:Adds the current working directory to your warp points'
'add!:Overwrites existing warp point'
'rm:Removes the given warp point'
- 'ls:Outputs all stored warp points'
- 'show:Outputs all warp points that point to the current directory'
+ 'list:Outputs all stored warp points'
+ 'ls:Show files from given warp point'
+ 'path:Show path to given warp point'
+ 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point'
'help:Show this extremely helpful text'
+ 'clean:Remove points warping to nonexistent directories'
+ 'clean!:Remove nonexistent directories without confirmation'
'..:Go back to last directory'
)
@@ -50,6 +47,15 @@ function _wd() {
add)
_message 'Write the name of your warp point' && ret=0
;;
+ show)
+ _describe -t points "Warp points" warp_points && ret=0
+ ;;
+ ls)
+ _describe -t points "Warp points" warp_points && ret=0
+ ;;
+ path)
+ _describe -t points "Warp points" warp_points && ret=0
+ ;;
esac
;;
esac
diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh
index 9800335fc..c0559293d 100755..100644
--- a/plugins/wd/wd.plugin.zsh
+++ b/plugins/wd/wd.plugin.zsh
@@ -1,7 +1,7 @@
#!/bin/zsh
-# WARP
-# ====
+# WARP DIRECTORY
+# ==============
# oh-my-zsh plugin
#
# @github.com/mfaerevaag/wd
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index 96a3426fc..3b9548168 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -1,110 +1,209 @@
#!/bin/zsh
-# WARP
-# ====
+# WARP DIRECTORY
+# ==============
# Jump to custom directories in terminal
# because `cd` takes too long...
#
# @github.com/mfaerevaag/wd
+# version
+readonly WD_VERSION=0.4
-## variables
-CONFIG=$HOME/.warprc
+# colors
+readonly WD_BLUE="\033[96m"
+readonly WD_GREEN="\033[92m"
+readonly WD_YELLOW="\033[93m"
+readonly WD_RED="\033[91m"
+readonly WD_NOC="\033[m"
-## colors
-BLUE="\033[96m"
-GREEN="\033[92m"
-YELLOW="\033[93m"
-RED="\033[91m"
-NOC="\033[m"
+## functions
+# helpers
+wd_yesorno()
+{
+ # variables
+ local question="${1}"
+ local prompt="${question} "
+ local yes_RETVAL="0"
+ local no_RETVAL="3"
+ local RETVAL=""
+ local answer=""
-# check if config file exists
-if [[ ! -a $CONFIG ]]
-then
- # if not: create config file
- touch $CONFIG
-fi
+ # read-eval loop
+ while true ; do
+ printf $prompt
+ read -r answer
-## load warp points
-typeset -A points
-while read line
-do
- arr=(${(s,:,)line})
- key=${arr[1]}
- val=${arr[2]}
+ case ${answer:=${default}} in
+ Y|y|YES|yes|Yes )
+ RETVAL=${yes_RETVAL} && \
+ break
+ ;;
+ N|n|NO|no|No )
+ RETVAL=${no_RETVAL} && \
+ break
+ ;;
+ * )
+ echo "Please provide a valid answer (y or n)"
+ ;;
+ esac
+ done
- points[$key]=$val
-done < $CONFIG
+ return ${RETVAL}
+}
+wd_print_msg()
+{
+ if [[ -z $wd_quiet_mode ]]
+ then
+ local color=$1
+ local msg=$2
-## functions
-# prepended wd_ to not conflict with your environment (no sub shell)
+ if [[ $color == "" || $msg == "" ]]
+ then
+ print " ${WD_RED}*${WD_NOC} Could not print message. Sorry!"
+ else
+ print " ${color}*${WD_NOC} ${msg}"
+ fi
+ fi
+}
+
+wd_print_usage()
+{
+ cat <<- EOF
+Usage: wd [command] <point>
+
+Commands:
+ add <point> Adds the current working directory to your warp points
+ add! <point> Overwrites existing warp point
+ rm <point> Removes the given warp point
+ show Print warp points to current directory
+ show <point> Print path to given warp point
+ list Print all stored warp points
+ls <point> Show files from given warp point
+path <point> Show the path to given warp point
+ clean! Remove points warping to nonexistent directories
+
+ -v | --version Print version
+ -d | --debug Exit after execution with exit codes (for testing)
+ -c | --config Specify config file (default ~/.warprc)
+ -q | --quiet Suppress all output
+
+ help Show this extremely helpful text
+EOF
+}
+
+wd_exit_fail()
+{
+ local msg=$1
+
+ wd_print_msg $WD_RED $msg
+ WD_EXIT_CODE=1
+}
+
+wd_exit_warn()
+{
+ local msg=$1
+
+ wd_print_msg $WD_YELLOW $msg
+ WD_EXIT_CODE=1
+}
+
+wd_getdir()
+{
+ local name_arg=$1
+
+ point=$(wd_show $name_arg)
+ dir=${point:28+$#name_arg+7}
+
+ if [[ -z $name_arg ]]; then
+ wd_exit_fail "You must enter a warp point"
+ break
+ elif [[ -z $dir ]]; then
+ wd_exit_fail "Unknown warp point '${name_arg}'"
+ break
+ fi
+}
+
+# core
wd_warp()
{
- if [[ $1 =~ "^\.+$" ]]
+ local point=$1
+
+ if [[ $point =~ "^\.+$" ]]
then
- if [[ $#1 < 2 ]]
+ if [ $#1 < 2 ]
then
- wd_print_msg $YELLOW "Warping to current directory?"
+ wd_exit_warn "Warping to current directory?"
else
(( n = $#1 - 1 ))
- #wd_print_msg $BLUE "Warping..."
cd -$n > /dev/null
fi
- elif [[ ${points[$1]} != "" ]]
+ elif [[ ${points[$point]} != "" ]]
then
- #wd_print_msg $BLUE "Warping..."
- cd ${points[$1]}
+ cd ${points[$point]}
else
- wd_print_msg $RED "Unkown warp point '$1'"
+ wd_exit_fail "Unknown warp point '${point}'"
fi
}
wd_add()
{
- if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]]
+ local force=$1
+ local point=$2
+
+ if [[ $point =~ "^[\.]+$" ]]
then
- wd_print_msg $RED "Illegal warp point (see README)."
- elif [[ ${points[$2]} == "" ]] || $1
+ wd_exit_fail "Warp point cannot be just dots"
+ elif [[ $point =~ "[[:space:]]+" ]]
then
- wd_remove $2 > /dev/null
- print "$2:$PWD" >> $CONFIG
- wd_print_msg $GREEN "Warp point added"
+ wd_exit_fail "Warp point should not contain whitespace"
+ elif [[ $point == *:* ]]
+ then
+ wd_exit_fail "Warp point cannot contain colons"
+ elif [[ $point == "" ]]
+ then
+ wd_exit_fail "Warp point cannot be empty"
+ elif [[ ${points[$2]} == "" ]] || $force
+ then
+ wd_remove $point > /dev/null
+ printf "%q:%s\n" "${point}" "${PWD}" >> $WD_CONFIG
+
+ wd_print_msg $WD_GREEN "Warp point added"
+
+ # override exit code in case wd_remove did not remove any points
+ # TODO: we should handle this kind of logic better
+ WD_EXIT_CODE=0
else
- wd_print_msg $YELLOW "Warp point '$2' already exists. Use 'add!' to overwrite."
+ wd_exit_warn "Warp point '${point}' already exists. Use 'add!' to overwrite."
fi
}
wd_remove()
{
- if [[ ${points[$1]} != "" ]]
+ local point=$1
+
+ if [[ ${points[$point]} != "" ]]
then
- if wd_tmp=`sed "/^$1:/d" $CONFIG`
+ local config_tmp=$WD_CONFIG.tmp
+ if sed -n "/^${point}:.*$/!p" $WD_CONFIG > $config_tmp && mv $config_tmp $WD_CONFIG
then
- # `>!` forces overwrite
- # we need this if people use `setopt NO_CLOBBER`
- echo $wd_tmp >! $CONFIG
- wd_print_msg $GREEN "Warp point removed"
+ wd_print_msg $WD_GREEN "Warp point removed"
else
- wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!"
+ wd_exit_fail "Something bad happened! Sorry."
fi
else
- wd_print_msg $RED "Warp point was not found"
+ wd_exit_fail "Warp point was not found"
fi
}
-wd_show()
-{
- wd_print_msg $BLUE "Warp points to current directory:"
- wd_list_all | grep $PWD$
-}
-
wd_list_all()
{
- wd_print_msg $BLUE "All warp points:"
- while read line
+ wd_print_msg $WD_BLUE "All warp points:"
+
+ while IFS= read -r line
do
if [[ $line != "" ]]
then
@@ -112,58 +211,161 @@ wd_list_all()
key=${arr[1]}
val=${arr[2]}
- print "\t" $key "\t -> \t" $val
+ if [[ -z $wd_quiet_mode ]]
+ then
+ printf "%20s -> %s\n" $key $val
+ fi
fi
- done < $CONFIG
+ done <<< $(sed "s:${HOME}:~:g" $WD_CONFIG)
}
-wd_print_msg()
+wd_ls()
+{
+ wd_getdir $1
+ ls $dir
+}
+
+wd_path()
{
- if [[ $1 == "" || $2 == "" ]]
+ wd_getdir $1
+ echo $(echo $dir | sed "s:${HOME}:~:g")
+}
+
+wd_show()
+{
+ local name_arg=$1
+ # if there's an argument we look up the value
+ if [[ ! -z $name_arg ]]
then
- print " $RED*$NOC Could not print message. Sorry!"
+ if [[ -z $points[$name_arg] ]]
+ then
+ wd_print_msg $WD_BLUE "No warp point named $name_arg"
+ else
+ wd_print_msg $WD_GREEN "Warp point: ${WD_GREEN}$name_arg${WD_NOC} -> $points[$name_arg]"
+ fi
else
- print " $1*$NOC $2"
+ # hax to create a local empty array
+ local wd_matches
+ wd_matches=()
+ # do a reverse lookup to check whether PWD is in $points
+ if [[ ${points[(r)$PWD]} == $PWD ]]
+ then
+ for name in ${(k)points}
+ do
+ if [[ $points[$name] == $PWD ]]
+ then
+ wd_matches[$(($#wd_matches+1))]=$name
+ fi
+ done
+
+ wd_print_msg $WD_BLUE "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}"
+ else
+ wd_print_msg $WD_YELLOW "No warp point to $(echo $PWD | sed "s:$HOME:~:")"
+ fi
fi
}
-wd_print_usage()
-{
- print "Usage: wd [add|-a|--add] [rm|-r|--remove] [ls|-l|--list] <point>"
- print "\nCommands:"
- print "\t add \t Adds the current working directory to your warp points"
- print "\t add! \t Overwrites existing warp point"
- print "\t rm \t Removes the given warp point"
- print "\t show \t Outputs warp points to current directory"
- print "\t ls \t Outputs all stored warp points"
- print "\t help \t Show this extremely helpful text"
+wd_clean() {
+ local force=$1
+ local count=0
+ local wd_tmp=""
+
+ while read line
+ do
+ if [[ $line != "" ]]
+ then
+ arr=(${(s,:,)line})
+ key=${arr[1]}
+ val=${arr[2]}
+
+ if [ -d "$val" ]
+ then
+ wd_tmp=$wd_tmp"\n"`echo $line`
+ else
+ wd_print_msg $WD_YELLOW "Nonexistent directory: ${key} -> ${val}"
+ count=$((count+1))
+ fi
+ fi
+ done < $WD_CONFIG
+
+ if [[ $count -eq 0 ]]
+ then
+ wd_print_msg $WD_BLUE "No warp points to clean, carry on!"
+ else
+ if $force || wd_yesorno "Removing ${count} warp points. Continue? (Y/n)"
+ then
+ echo $wd_tmp >! $WD_CONFIG
+ wd_print_msg $WD_GREEN "Cleanup complete. ${count} warp point(s) removed"
+ else
+ wd_print_msg $WD_BLUE "Cleanup aborted"
+ fi
+ fi
}
+local WD_CONFIG=$HOME/.warprc
+local WD_QUIET=0
+local WD_EXIT_CODE=0
+local WD_DEBUG=0
+
+# Parse 'meta' options first to avoid the need to have them before
+# other commands. The `-D` flag consumes recognized options so that
+# the actual command parsing won't be affected.
+
+zparseopts -D -E \
+ c:=wd_alt_config -config:=wd_alt_config \
+ q=wd_quiet_mode -quiet=wd_quiet_mode \
+ v=wd_print_version -version=wd_print_version \
+ d=wd_debug_mode -debug=wd_debug_mode
+
+if [[ ! -z $wd_print_version ]]
+then
+ echo "wd version $WD_VERSION"
+fi
-## run
+if [[ ! -z $wd_alt_config ]]
+then
+ WD_CONFIG=$wd_alt_config[2]
+fi
+
+# check if config file exists
+if [ ! -e $WD_CONFIG ]
+then
+ # if not, create config file
+ touch $WD_CONFIG
+fi
+
+# load warp points
+typeset -A points
+while read -r line
+do
+ arr=(${(s,:,)line})
+ key=${arr[1]}
+ val=${arr[2]}
+
+ points[$key]=$val
+done < $WD_CONFIG
# get opts
-args=`getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*`
+args=$(getopt -o a:r:c:lhs -l add:,rm:,clean\!,list,ls:,path:,help,show -- $*)
-# check if no arguments were given
-if [[ $? -ne 0 || $#* -eq 0 ]]
+# check if no arguments were given, and that version is not set
+if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]]
then
wd_print_usage
-# check if config file is writeable
-elif [[ ! -w $CONFIG ]]
+ # check if config file is writeable
+elif [ ! -w $WD_CONFIG ]
then
- wd_print_msg $RED "\'$CONFIG\' is not writeable."
- # do nothing => exit
+ # do nothing
# can't run `exit`, as this would exit the executing shell
- # i.e. your terminal
+ wd_exit_fail "\'$WD_CONFIG\' is not writeable."
else
- #set -- $args # WTF
- for i
+ # parse rest of options
+ for o
do
- case "$i"
+ case "$o"
in
-a|--add|add)
wd_add false $2
@@ -177,20 +379,36 @@ else
wd_remove $2
break
;;
- -l|--list|ls)
+ -l|list)
wd_list_all
break
;;
+ -ls|ls)
+ wd_ls $2
+ break
+ ;;
+ -p|--path|path)
+ wd_path $2
+ break
+ ;;
-h|--help|help)
wd_print_usage
break
;;
-s|--show|show)
- wd_show
+ wd_show $2
+ break
+ ;;
+ -c|--clean|clean)
+ wd_clean false
+ break
+ ;;
+ -c!|--clean!|clean!)
+ wd_clean true
break
;;
*)
- wd_warp $i
+ wd_warp $o
break
;;
--)
@@ -200,10 +418,29 @@ else
done
fi
-
## garbage collection
# if not, next time warp will pick up variables from this run
# remember, there's no sub shell
-unset points
+
+unset wd_warp
+unset wd_add
+unset wd_remove
+unset wd_show
+unset wd_list_all
+unset wd_print_msg
+unset wd_yesorno
+unset wd_print_usage
+unset wd_alt_config
+unset wd_quiet_mode
+unset wd_print_version
+
unset args
+unset points
unset val &> /dev/null # fixes issue #1
+
+if [[ ! -z $wd_debug_mode ]]
+then
+ exit $WD_EXIT_CODE
+else
+ unset wd_debug_mode
+fi
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 8eedb90ee..572427b0b 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -1,45 +1,46 @@
# web_search from terminal
function web_search() {
-
- # get the open command
- local open_cmd
- if [[ $(uname -s) == 'Darwin' ]]; then
- open_cmd='open'
- else
- open_cmd='xdg-open'
- fi
+ emulate -L zsh
+
+ # define search engine URLS
+ typeset -A urls
+ urls=(
+ google "https://www.google.com/search?q="
+ bing "https://www.bing.com/search?q="
+ yahoo "https://search.yahoo.com/search?p="
+ duckduckgo "https://www.duckduckgo.com/?q="
+ yandex "https://yandex.ru/yandsearch?text="
+ )
+
+ # define the open command
+ case "$OSTYPE" in
+ darwin*) open_cmd="open" ;;
+ cygwin*) open_cmd="cygstart" ;;
+ linux*) open_cmd="xdg-open" ;;
+ *) echo "Platform $OSTYPE not supported"
+ return 1
+ ;;
+ esac
# check whether the search engine is supported
- if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]];
- then
+ if [[ -z "$urls[$1]" ]]; then
echo "Search engine $1 not supported."
return 1
fi
- local url="http://www.$1.com"
-
- # no keyword provided, simply open the search engine homepage
- if [[ $# -le 1 ]]; then
- $open_cmd "$url"
- return
- fi
- if [[ $1 == 'duckduckgo' ]]; then
- #slightly different search syntax for DDG
- url="${url}/?q="
+ # search or go to main page depending on number of arguments passed
+ if [[ $# -gt 1 ]]; then
+ # build search url:
+ # join arguments passed with '+', then append to search engine URL
+ url="${urls[$1]}${(j:+:)@[2,-1]}"
else
- url="${url}/search?q="
+ # build main page url:
+ # split by '/', then rejoin protocol (1) and domain (2) parts with '//'
+ url="${(j://:)${(s:/:)urls[$1]}[1,2]}"
fi
- shift # shift out $1
-
- while [[ $# -gt 0 ]]; do
- url="${url}$1+"
- shift
- done
- url="${url%?}" # remove the last '+'
-
- $open_cmd "$url"
+ nohup $open_cmd "$url" &>/dev/null
}
@@ -47,6 +48,8 @@ alias bing='web_search bing'
alias google='web_search google'
alias yahoo='web_search yahoo'
alias ddg='web_search duckduckgo'
+alias yandex='web_search yandex'
+
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
alias news='web_search duckduckgo \!n'
diff --git a/plugins/wp-cli/README.md b/plugins/wp-cli/README.md
new file mode 100644
index 000000000..6dda07d17
--- /dev/null
+++ b/plugins/wp-cli/README.md
@@ -0,0 +1,105 @@
+# WP-CLI
+
+**Maintainer:** [joshmedeski](https://github.com/joshmedeski)
+
+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.
+
+## List of Aliases
+
+### Core
+- wpcc='wp core config'
+- wpcd='wp core download'
+- wpci='wp core install'
+- wpcii='wp core is-installed'
+- wpcmc='wp core multisite-convert'
+- wpcmi='wp core multisite-install'
+- wpcu='wp core update'
+- wpcudb='wp core update-db'
+- wpcvc='wp core verify-checksums'
+
+### Cron
+- wpcre='wp cron event'
+- wpcrs='wp cron schedule'
+- wpcrt='wp cron test'
+
+### Menu
+- wpmc='wp menu create'
+- wpmd='wp menu delete'
+- wpmi='wp menu item'
+- wpml='wp menu list'
+- wpmlo='wp menu location'
+
+### Plugin
+- wppa='activate'
+- wppda='deactivate'
+- wppd='delete'
+- wppg='get'
+- wppi='install'
+- wppis='is-installed'
+- wppl='list'
+- wppp='path'
+- wpps='search'
+- wppst='status'
+- wppt='toggle'
+- wppu='uninstall'
+- wppu='update'
+
+### Post
+- wppoc='wp post create'
+- wppod='wp post delete'
+- wppoe='wp post edit'
+- wppogen='wp post generate'
+- wppog='wp post get'
+- wppol='wp post list'
+- wppom='wp post meta'
+- wppou='wp post update'
+- wppou='wp post url'
+
+### Sidebar
+- wpsbl='wp sidebar list'
+
+### Theme
+- wpta='wp theme activate'
+- wptd='wp theme delete'
+- wptdis='wp theme disable'
+- wpte='wp theme enable'
+- wptg='wp theme get'
+- wpti='wp theme install'
+- wptis='wp theme is-installed'
+- wptl='wp theme list'
+- wptm='wp theme mod'
+- wptp='wp theme path'
+- wpts='wp theme search'
+- wptst='wp theme status'
+- wptu='wp theme updatet'
+
+### User
+- wpuac='wp user add-cap'
+- wpuar='wp user add-role'
+- wpuc='wp user create'
+- wpud='wp user delete'
+- wpugen='wp user generate'
+- wpug='wp user get'
+- wpui='wp user import-csv'
+- wpul='wp user list'
+- wpulc='wp user list-caps'
+- wpum='wp user meta'
+- wpurc='wp user remove-cap'
+- wpurr='wp user remove-role'
+- wpusr='wp user set-role'
+- wpuu='wp user update'
+
+### Widget
+- wpwa='wp widget add'
+- wpwda='wp widget deactivate'
+- wpwd='wp widget delete'
+- wpwl='wp widget list'
+- wpwm='wp widget move'
+- wpwu='wp widget update'
+
+The entire list of wp-cli commands can be found here: http://wp-cli.org/commands/
+
+I only included the commands that are most used. Please feel free to contribute to this project if you want more commands.
+
diff --git a/plugins/wp-cli/wp-cli.plugin.zsh b/plugins/wp-cli/wp-cli.plugin.zsh
new file mode 100644
index 000000000..6c70a7a09
--- /dev/null
+++ b/plugins/wp-cli/wp-cli.plugin.zsh
@@ -0,0 +1,160 @@
+# WP-CLI
+# A command line interface for WordPress
+# http://wp-cli.org/
+
+# Cache
+
+# Cap
+
+# CLI
+
+# Comment
+
+# Core
+alias wpcc='wp core config'
+alias wpcd='wp core download'
+alias wpci='wp core install'
+alias wpcii='wp core is-installed'
+alias wpcmc='wp core multisite-convert'
+alias wpcmi='wp core multisite-install'
+alias wpcu='wp core update'
+alias wpcudb='wp core update-db'
+alias wpcvc='wp core verify-checksums'
+
+# Cron
+alias wpcre='wp cron event'
+alias wpcrs='wp cron schedule'
+alias wpcrt='wp cron test'
+
+# Db
+
+# Eval
+
+# Eval-File
+
+# Export
+
+# Help
+
+# Import
+
+# Media
+
+# Menu
+alias wpmc='wp menu create'
+alias wpmd='wp menu delete'
+alias wpmi='wp menu item'
+alias wpml='wp menu list'
+alias wpmlo='wp menu location'
+
+# Network
+
+# Option
+
+# Plugin
+alias wppa='wp plugin activate'
+alias wppda='wp plugin deactivate'
+alias wppd='wp plugin delete'
+alias wppg='wp plugin get'
+alias wppi='wp plugin install'
+alias wppis='wp plugin is-installed'
+alias wppl='wp plugin list'
+alias wppp='wp plugin path'
+alias wpps='wp plugin search'
+alias wppst='wp plugin status'
+alias wppt='wp plugin toggle'
+alias wppu='wp plugin uninstall'
+alias wppu='wp plugin update'
+
+# Post
+alias wppoc='wp post create'
+alias wppod='wp post delete'
+alias wppoe='wp post edit'
+alias wppogen='wp post generate'
+alias wppog='wp post get'
+alias wppol='wp post list'
+alias wppom='wp post meta'
+alias wppou='wp post update'
+alias wppou='wp post url'
+
+# Rewrite
+
+# Role
+
+# Scaffold
+
+# Search-Replace
+
+# Shell
+
+# Sidebar
+alias wpsbl='wp sidebar list'
+
+# Site
+
+# Super-Admin
+
+# Term
+
+# Theme
+alias wpta='wp theme activate'
+alias wptd='wp theme delete'
+alias wptdis='wp theme disable'
+alias wpte='wp theme enable'
+alias wptg='wp theme get'
+alias wpti='wp theme install'
+alias wptis='wp theme is-installed'
+alias wptl='wp theme list'
+alias wptm='wp theme mod'
+alias wptp='wp theme path'
+alias wpts='wp theme search'
+alias wptst='wp theme status'
+alias wptu='wp theme updatet'
+
+# Transient
+
+# User
+alias wpuac='wp user add-cap'
+alias wpuar='wp user add-role'
+alias wpuc='wp user create'
+alias wpud='wp user delete'
+alias wpugen='wp user generate'
+alias wpug='wp user get'
+alias wpui='wp user import-csv'
+alias wpul='wp user list'
+alias wpulc='wp user list-caps'
+alias wpum='wp user meta'
+alias wpurc='wp user remove-cap'
+alias wpurr='wp user remove-role'
+alias wpusr='wp user set-role'
+alias wpuu='wp user update'
+
+# Widget
+alias wpwa='wp widget add'
+alias wpwda='wp widget deactivate'
+alias wpwd='wp widget delete'
+alias wpwl='wp widget list'
+alias wpwm='wp widget move'
+alias wpwu='wp widget update'
+
+
+autoload -U +X bashcompinit && bashcompinit
+# bash completion for the `wp` command
+
+_wp_complete() {
+ local cur=${COMP_WORDS[COMP_CWORD]}
+
+ IFS=$'\n'; # want to preserve spaces at the end
+ local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")"
+
+ if [[ "$opts" =~ \<file\>\s* ]]
+ then
+ COMPREPLY=( $(compgen -f -- $cur) )
+ elif [[ $opts = "" ]]
+ then
+ COMPREPLY=( $(compgen -f -- $cur) )
+ else
+ COMPREPLY=( ${opts[*]} )
+ fi
+}
+complete -o nospace -F _wp_complete wp
diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
index 4816ab0ed..1d1205b80 100644
--- a/plugins/xcode/xcode.plugin.zsh
+++ b/plugins/xcode/xcode.plugin.zsh
@@ -1,6 +1,6 @@
#xc function courtesy of http://gist.github.com/subdigital/5420709
function xc {
- xcode_proj=`find . -name "*.xc*" -d 1 | sort -r | head -1`
+ xcode_proj=`ls | grep "\.xc" | sort -r | head -1`
if [[ `echo -n $xcode_proj | wc -m` == 0 ]]
then
echo "No xcworkspace/xcodeproj file found in the current directory."
@@ -16,4 +16,10 @@ function xcsel {
alias xcb='xcodebuild'
alias xcp='xcode-select --print-path'
-alias simulator='open $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
+alias xcdd='rm -rf ~/Library/Developer/Xcode/DerivedData/*'
+
+if [[ -d $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ]]; then
+ alias simulator='open $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
+else
+ alias simulator='open $(xcode-select -p)/Applications/iOS\ Simulator.app'
+fi
diff --git a/plugins/yii2/README.md b/plugins/yii2/README.md
new file mode 100644
index 000000000..345b66eb6
--- /dev/null
+++ b/plugins/yii2/README.md
@@ -0,0 +1,7 @@
+# Yii2 autocomplete plugin
+
+* Adds autocomplete commands and subcommands for yii.
+
+## Requirements
+
+Autocomplete works from directory where your `yii` file contains.
diff --git a/plugins/yii2/yii2.plugin.zsh b/plugins/yii2/yii2.plugin.zsh
new file mode 100644
index 000000000..e8993adf4
--- /dev/null
+++ b/plugins/yii2/yii2.plugin.zsh
@@ -0,0 +1,29 @@
+# Yii2 command completion
+
+_yii2_format_command () {
+ awk '/^- [a-z]+/ { sub(":", "", $2); print $2 }'
+}
+
+_yii2 () {
+ if [ -f ./yii ]; then
+ _arguments \
+ '1: :->command'\
+ '*: :->params'
+
+ case $state in
+ command)
+
+ local -a commands
+ local -a name
+
+ if [[ $words[2] == *\/ ]]; then
+ name=$words[2]
+ fi
+
+ commands=(${(f)"$(./yii help $name --color=0 | _yii2_format_command)"})
+ compadd -Q -S '' -a -- commands
+ esac
+ fi
+}
+
+compdef _yii2 yii \ No newline at end of file
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index 94945bd48..cde9ebeca 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -1,10 +1,11 @@
# reload zshrc
function src()
{
+ local cache=$ZSH_CACHE_DIR
autoload -U compinit zrecompile
- compinit -d "$ZSH/cache/zcomp-$HOST"
+ compinit -d "$cache/zcomp-$HOST"
- for f in ~/.zshrc "$ZSH/cache/zcomp-$HOST"; do
+ for f in ~/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old
done