1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-24 06:40:07 +00:00

Merge branch 'master' into fold-terminalapp-plugin-into-termsupport

This commit is contained in:
Andrew Janke 2015-08-17 20:59:39 -04:00
commit 00eb465830
144 changed files with 8194 additions and 1215 deletions

View file

@ -1,6 +1,6 @@
The MIT License The MIT License
Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) Copyright (c) 2009-2015 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

201
README.markdown Normal file
View file

@ -0,0 +1,201 @@
![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
__Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interact with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
### Prerequisites
__Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
* Unix-based operating system (Mac OS X or Linux)
* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
* `git` should be installed
### Basic Installation
Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`.
#### via curl
`sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"`
#### via wget
`sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"`
## Using Oh My Zsh
### Plugins
Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
#### Enabling Plugins
If you spot a plugin (or several) that you would like to use with Oh My Zsh, you will need to edit the `~/.zshrc` file. Once you open it with your favorite editor, you'll see a spot to list all the plugins that you'd like Oh My Zsh to load in initialization.
For example, this line might begin to look like...
```shell
plugins=(git bundler osx rake ruby)
```
#### Using Plugins
Most plugins (should! we're working on this) include a __README__, which documents how to use them.
### Themes
We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out!
#### Selecting a Theme
_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just right (for him)._
Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
```shell
ZSH_THEME="robbyrussell"
```
To use a different theme, simple change the value to match the name of your desired theme. For example:
```shell
ZSH_THEME="agnoster" # (this is one of the fancy ones)
```
Open up a new terminal window and your prompt should look something like...
![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png)
In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes).
## Advanced Topics
If you're the type that likes to get their hands dirty, these sections might resonate.
### Advanced Installation
Some users may want to change the default path, or manually install Oh My Zsh.
#### Custom Directory
The default location is `~/.oh-my-zsh` (hidden in your home directory)
If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
```shell
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh
```
#### Manual Installation
##### 1. Clone the repository:
```shell
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
```
##### 2. *Optionally*, backup your existing `~/.zshrc` file:
```shell
cp ~/.zshrc ~/.zshrc.orig
```
##### 3. Create a new zsh configuration file
You can create a new zsh config file by copying the template that we included for you.
```shell
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
```
##### 4. Change your default shell
```shell
chsh -s /bin/zsh
```
##### 5. Initialize your new zsh configuration
Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
### Installation Problems
If you have any hiccups installing, here are a few common fixes.
* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
* If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.
### Custom Plugins and Themes
If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory.
If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
## Getting Updates
By default, you will be prompted to check for upgrades every few weeks. If you would like `oh-my-zsh` to automatically upgrade itself without prompting you, set the following in your `~/.zshrc`:
```shell
DISABLE_UPDATE_PROMPT=true
```
To disable automatic upgrades, set the following in your `~/.zshrc`:
```shell
DISABLE_AUTO_UPDATE=true
```
### Manual Updates
If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
```shell
upgrade_oh_my_zsh
```
Magic!
## Uninstalling Oh My Zsh
Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.
## Contributing
I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
### Do NOT send us themes
We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page.
## Contributors
Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome.
Thank you so much!
## Follow Us
We have an [@ohmyzsh](https://twitter.com/ohmyzsh) Twitter account. You should follow it.
## Merchandise
We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town!
## License
Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt).

View file

@ -1,111 +0,0 @@
!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
@oh-my-zsh@ is an open source, community-driven framework for managing your "Zsh":http://www.zsh.org/ configuration.
It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…
bq. "OH MY ZSHELL!"
h2. Setup
@oh-my-zsh@ should work with any recent release of "Zsh":http://www.zsh.org/. The minimum recommended version is *4.3.9*.
If not already installed, you can install "Zsh":http://www.zsh.org/ using the command-line.
h3. The automatic installer… do you trust me?
You can install this via the command-line with either @curl@ or @wget@.
h4. via @curl@:
@curl -L http://install.ohmyz.sh | sh@
h4. via @wget@:
@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
h4. *Optionally*, change the install directory:
The default location is @~/.oh-my-zsh@ (hidden in your home directory).
You can change the install directory with the @ZSH@ environment variable, either by running @export ZSH=/your/path@ before installing, or by setting it before the end of the install pipeline like this:
@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
h3. The manual way
1. Clone the repository:
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
2. *Optionally*, backup your existing @~/.zshrc@ file:
@cp ~/.zshrc ~/.zshrc.orig@
3. Create a new "Zsh":http://www.zsh.org/ config file by copying the "Zsh":http://www.zsh.org/ template we've provided:
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
4. Set "Zsh":http://www.zsh.org/ as your default shell:
@chsh -s /bin/zsh@
5. Start or restart "Zsh":http://www.zsh.org/ by opening a new command-line window.
h3. Problems?
You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to @oh-my-zsh@.
If you installed manually or changed the install location, check the @ZSH@ environment variable in @~/.zshrc@.
h2. Usage
* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's available)
** example: @plugins=(git osx ruby)@
* theme support: change the @ZSH_THEME@ environment variable in @~/.zshrc@
** take a look at the @themes/@ directory and the "wiki":https://wiki.github.com/robbyrussell/oh-my-zsh/themes to see what comes bundled with @oh-my-zsh@
* & much, much more… take a look at the @lib/@ directory to see what @oh-my-zsh@ has to offer…
h2. Useful
The "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty useful for tips.
h3. Customization
If you want to override any of the default behaviors, just add a new file (ending in @.zsh@) in the @custom/@ directory.
If you have many functions that go well together, you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin (see '"Usage":https://github.com/robbyrussell/oh-my-zsh#usage' above).
If you would like to override the functionality of a plugin distributed with @oh-my-zsh@, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
h3. Updates
By default you will be prompted to check for upgrades. If you would like @oh-my-zsh@ to automatically upgrade itself without prompting you, set the following in your @~/.zshrc@:
@DISABLE_UPDATE_PROMPT=true@
To disable upgrades entirely, set the following in your @~/.zshrc@:
@DISABLE_AUTO_UPDATE=true@
To upgrade directly from the command-line, just run @upgrade_oh_my_zsh@.
h3. Uninstalling
If you want to uninstall @oh-my-zsh@, just run @uninstall_oh_my_zsh@ from the command-line and it'll remove itself and revert you to @bash@ (or your previous "Zsh":http://www.zsh.org/ configuration).
h2. Help out!
I'm far from being a "Zsh":http://www.zsh.org/ expert and suspect there are many ways to improve if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
h3. (Don't) send us your theme (for now)!
-I'm hoping to collect a bunch of themes you can see existing ones in the @themes/@ directory.-
We have enough themes for the time being. Please fork the project and add on in there you can let people know how to grab it from there.
h2. Contributors
This project wouldn't exist without all of our awesome users and contributors: "view our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
Thank you so much!

View file

@ -15,7 +15,12 @@ if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset CASE_SENSITIVE unset CASE_SENSITIVE
else else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset HYPHEN_INSENSITIVE
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
fi
fi fi
zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-colors ''
@ -34,7 +39,6 @@ fi
# disable named-directories autocompletion # disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
cdpath=(.)
# Use caching so that commands like apt and dpkg complete are useable # Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1 zstyle ':completion::complete:*' use-cache 1

View file

@ -24,9 +24,9 @@ alias d='dirs -v | head -10'
# List directory contents # List directory contents
alias lsa='ls -lah' alias lsa='ls -lah'
alias l='ls -la' alias l='ls -lah'
alias ll='ls -l' alias ll='ls -lh'
alias la='ls -lA' alias la='ls -lAh'
# Push and pop directories on directory stack # Push and pop directories on directory stack
alias pu='pushd' alias pu='pushd'

View file

@ -15,6 +15,22 @@ function take() {
cd $1 cd $1
} }
function open_command() {
local open_cmd
# 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
nohup $open_cmd "$@" &>/dev/null
}
# #
# Get the value of an alias. # Get the value of an alias.
# #

View file

@ -36,24 +36,27 @@ git_remote_status() {
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [ $ahead -eq 0 ] && [ $behind -gt 0 ] if [ $ahead -gt 0 ] && [ $behind -eq 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
elif [ $ahead -gt 0 ] && [ $behind -eq 0 ] git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [ $behind -gt 0 ] && [ $ahead -eq 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [ $ahead -gt 0 ] && [ $behind -gt 0 ] elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi fi
fi
}
# Checks if there are commits ahead from remote if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]
function git_prompt_ahead() { then
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi
fi
echo $git_remote_status
fi
} }
# Gets the number of commits ahead from remote # Gets the number of commits ahead from remote
@ -64,6 +67,29 @@ function git_commits_ahead() {
fi fi
} }
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
fi
}
# Formats prompt string for current git commit short SHA # Formats prompt string for current git commit short SHA
function git_prompt_short_sha() { function git_prompt_short_sha() {
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"

View file

@ -3,8 +3,12 @@ grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1 echo | grep $1 "" >/dev/null 2>&1
} }
GREP_OPTIONS=""
# color grep results # color grep results
GREP_OPTIONS="--color=auto" if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available) # ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}" VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"

View file

@ -1,6 +1,10 @@
## smart urls ## Load smart urls if available
autoload -U url-quote-magic for d in $fpath; do
zle -N self-insert url-quote-magic if [[ -e "$d/url-quote-magic" ]]; then
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
fi
done
## jobs ## jobs
setopt long_list_jobs setopt long_list_jobs
@ -20,3 +24,6 @@ alias afind='ack-grep -il'
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
fi fi
# recognize comments
setopt interactivecomments

View file

@ -8,6 +8,8 @@
# Limited support for Apple Terminal (Terminal can't set window and tab separately) # Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title { function title {
emulate -L zsh emulate -L zsh
setopt prompt_subst
[[ "$EMACS" == *term* ]] && return [[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default # if $2 is unset use $1 as default
@ -24,6 +26,10 @@ function title {
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt # Runs before showing the prompt
function omz_termsupport_precmd { function omz_termsupport_precmd {
@ -45,7 +51,7 @@ function omz_termsupport_preexec {
setopt extended_glob setopt extended_glob
# cmd name only, or if this is sudo or ssh, the next cmd # cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%} local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}" local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<' title '$CMD' '%100>...>$LINE%<<'

View file

@ -14,7 +14,7 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom" ZSH_CUSTOM="$ZSH/custom"
fi fi
# Set ZSH_CACHE_DIR to the path where cache files sould be created # Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/ # or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache/" ZSH_CACHE_DIR="$ZSH/cache/"

View file

@ -16,13 +16,22 @@ _1st_arguments=(
'help:show the help message' 'help:show the help message'
'install:push this package file to the device and install it' 'install:push this package file to the device and install it'
'jdwp:list PIDs of processes hosting a JDWP transport' 'jdwp:list PIDs of processes hosting a JDWP transport'
'logcat:View device log' 'kill-server:kill the server if it is running'
'logcat:view device log'
'pull:copy file/dir from device' 'pull:copy file/dir from device'
'push:copy file/dir to device' 'push:copy file/dir to device'
'reboot:reboots the device, optionally into the bootloader or recovery program'
'reboot-bootloader:reboots the device into the bootloader'
'remount:remounts the partitions on the device read-write'
'root:restarts the adbd daemon with root permissions'
'sideload:push a ZIP to device and install it'
'shell:run remote shell interactively' 'shell:run remote shell interactively'
'sync:copy host->device only if changed (-l means list but dont copy)' 'sync:copy host->device only if changed (-l means list but dont copy)'
'start-server:ensure that there is a server running'
'tcpip:restart host adb in tcpip mode'
'uninstall:remove this app package from the device' 'uninstall:remove this app package from the device'
'version:show version num' 'version:show version num'
'wait-for-device:block until device is online'
) )
local expl local expl

View file

@ -0,0 +1,19 @@
## APACHE2 MACPORTS PLUGIN
---
### FEATURES
| Alias | Function | Description |
|:--------------:|:-------------------------------------------------------------------------------|----------------------:|
| apache2restart | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart | Restart apache daemon |
| apache2start | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start | Start apache daemon |
| apache2stop | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop | Stop apache daemon |
---
### CONTRIBUTORS
- Alexander Rinass (alex@rinass.net)
---

View file

@ -0,0 +1,64 @@
## ARCHLINUX PLUGIN
---
### FEATURES
| Alias | Function | Description |
|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
| pacin | sudo pacman -S | Install specific package(s) from the repositories |
| pacins | sudo pacman -U | Install specific package not from the repositories but from a file |
| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package |
| pacloc | pacman -Qi | Display information about a given package in the local database |
| paclocs | pacman -Qs | Search for package(s) in the local database |
| paclsorphans | sudo pacman -Qdt' | List all orphaned packages |
| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
| pacrep | pacman -Si | Display information about a given package in the repositories |
| pacreps | pacman -Ss | Search for package(s) in the repositories |
| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages |
| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories |
| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. |
| yaconf | yaourt -C | Fix all configuration files with vimdiff |
| yain | yaourt -S | Install specific package(s) from the repositories |
| yains | yaourt -U | Install specific package not from the repositories but from a file |
| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package |
| yaloc | yaourt -Qi | Display information about a given package in the local database |
| yalocs | yaourt -Qs | Search for package(s) in the local database |
| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") |
| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
| yaorph | yaourt -Qtd | Remove orphans using yaourt |
| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
| yarep | yaourt -Si | Display information about a given package in the repositories |
| yareps | yaourt -Ss | Search for package(s) in the repositories |
| yasu | yaourt --sucre | Same as yaupg, but without confirmation |
| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
| yaupd | yaourt -Sy | Update and refresh the local package database against repositories |
| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system |
| Function | Description |
|----------------|:------------------------------------------------------------------------------------------------------------------|
| pacdisowned | List all disowned files in your system |
| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) |
| pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | |
---
### CONTRIBUTORS
- Benjamin Boudreau - dreurmail@gmail.com
- Celso Miranda - contacto@celsomiranda.net
- KhasMek - Boushh@gmail.com
- Martin Putniorz - mputniorz@gmail.com
- MatthR3D - matthr3d@gmail.com
- ornicar - thibault.duplessis@gmail.com
---

View file

@ -2,7 +2,7 @@
# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
# Look for yaourt, and add some useful functions if we have it. # Look for yaourt, and add some useful functions if we have it.
if [[ -x `which yaourt` ]]; then if [[ -x `command -v yaourt` ]]; then
upgrade () { upgrade () {
yaourt -Syu yaourt -Syu
} }
@ -21,11 +21,11 @@ if [[ -x `which yaourt` ]]; then
alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") 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 alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
# Additional yaourt alias examples # Additional yaourt alias examples
if [[ -x `which abs` && -x `which aur` ]]; then if [[ -x `command -v abs` && -x `command -v aur` ]]; then
alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories 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 elif [[ -x `command -v abs` ]]; then
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
elif [[ -x `which aur` ]]; then elif [[ -x `command -v aur` ]]; then
alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else else
alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
alias pacloc='pacman -Qi' # Display information about a given package in the local database alias 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 alias paclocs='pacman -Qs' # Search for package(s) in the local database
# Additional pacman alias examples # Additional pacman alias examples
if [[ -x `which abs` && -x `which aur` ]]; then if [[ -x `command -v abs` && -x `command -v aur` ]]; then
alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories 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 elif [[ -x `command -v abs` ]]; then
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
elif [[ -x `which aur` ]]; then elif [[ -x `command -v aur` ]]; then
alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else else
alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
@ -63,7 +63,7 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li
# https://bbs.archlinux.org/viewtopic.php?id=93683 # https://bbs.archlinux.org/viewtopic.php?id=93683
paclist() { paclist() {
sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' LC_ALL=C pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
} }
alias paclsorphans='sudo pacman -Qdt' alias paclsorphans='sudo pacman -Qdt'

17
plugins/atom/README.md Normal file
View file

@ -0,0 +1,17 @@
## atom
Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
### Requirements
* [Atom](https://atom.io/)
### Usage
* If `at` command is called without an argument, launch Atom
* If `at` is passed a directory, `cd` to it and open it in Atom
* If `at` is passed a file, open it in Atom
* if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom

View file

@ -13,7 +13,8 @@ function agp {
} }
function asp { function asp {
export AWS_DEFAULT_PROFILE=$1 export AWS_DEFAULT_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>" export AWS_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$RPROMPT"
} }
function aws_profiles { function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
@ -22,7 +23,7 @@ function aws_profiles {
compctl -K aws_profiles asp compctl -K aws_profiles asp
if _homebrew-installed && _awscli-homebrew-installed ; then if _homebrew-installed && _awscli-homebrew-installed ; then
_aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh
else else
_aws_zsh_completer_path=$(which aws_zsh_completer.sh) _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
fi fi

View file

@ -0,0 +1,54 @@
# bgnotify zsh plugin
cross-platform background notifications for long running commands! Supports OSX and Ubuntu linux.
Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-background-notify)
----------------------------------
## How to use!
Just add bgnotify to your plugins list in your `.zshrc`
- On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier)
* `brew install terminal-notifier` (or `gem install terminal-notifier`)
- On ubuntu you're already all set!
- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
## Screenshots
**Linux**
![screenshot from 2014-11-07 15 58 36](https://cloud.githubusercontent.com/assets/326829/4962187/256b465c-66da-11e4-927d-cc2fc105e31f.png)
**OS X**
![screenshot 2014-11-08 14 15 12](https://cloud.githubusercontent.com/assets/326829/4965780/19fa3eac-6795-11e4-8ed6-0355711123a9.png)
**Windows**
![screenshot from 2014-11-07 15 55 00](https://cloud.githubusercontent.com/assets/326829/4962159/a2625ca0-66d9-11e4-9e91-c5834913190e.png)
## Configuration
One can configure a few things:
- `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
- `function bgnotify_formatted` lets you change the notification
Use these by adding a function definition before the your call to source. Example:
~~~ sh
bgnotify_threshold=4 ## set your own notification threshold
function bgnotify_formatted {
## $1=exit_status, $2=command, $3=elapsed_time
[ $1 -eq 0 ] && title="Holy Smokes Batman!" || title="Holy Graf Zeppelin!"
bgnotify "$title -- after $3 s" "$2";
}
plugins=(git bgnotify) ## add to plugins list
source $ZSH/oh-my-zsh.sh ## existing source call
~~~

View file

@ -0,0 +1,67 @@
#!/usr/bin/env zsh
## setup ##
[[ -o interactive ]] || return #interactive only!
zmodload zsh/datetime || { print "can't load zsh/datetime"; return } # faster than date()
autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
(( ${+bgnotify_threshold} )) || bgnotify_threshold=5 #default 10 seconds
## definitions ##
if ! (type bgnotify_formatted | grep -q 'function'); then
function bgnotify_formatted {
## exit_status, command, elapsed_time
[ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
bgnotify "$title" "$2"
}
fi
currentWindowId () {
if hash osascript 2>/dev/null; then #osx
osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
elif hash notify-send 2>/dev/null; then #ubuntu!
xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
else
echo $EPOCHSECONDS #fallback for windows
fi
}
bgnotify () {
if hash terminal-notifier 2>/dev/null; then #osx
terminal-notifier -message "$2" -title "$1"
elif hash growlnotify 2>/dev/null; then #osx growl
growlnotify -m "$1" "$2"
elif hash notify-send 2>/dev/null; then #ubuntu!
notify-send "$1" "$2"
elif hash notifu 2>/dev/null; then #cygwyn support!
notifu /m "$2" /p "$1"
fi
}
## Zsh hooks ##
bgnotify_begin() {
bgnotify_timestamp=$EPOCHSECONDS
bgnotify_lastcmd=$1
bgnotify_windowid=$(currentWindowId)
}
bgnotify_end() {
didexit=$?
elapsed=$(( EPOCHSECONDS - bgnotify_timestamp ))
past_threshold=$(( elapsed >= bgnotify_threshold ))
if (( bgnotify_timestamp > 0 )) && (( past_threshold )); then
if [ $(currentWindowId) != "$bgnotify_windowid" ]; then
print -n "\a"
bgnotify_formatted "$didexit" "$bgnotify_lastcmd" "$elapsed"
fi
fi
bgnotify_timestamp=0 #reset it to 0!
}
add-zsh-hook preexec bgnotify_begin
add-zsh-hook precmd bgnotify_end

View file

@ -0,0 +1,6 @@
## Boot2docker autocomplete plugin
- Adds autocomplete options for all boot2docker commands.
Maintainer : Manfred Touron ([@moul](https://github.com/moul))

View file

@ -0,0 +1,73 @@
#compdef boot2docker
# Boot2docker autocompletion for oh-my-zsh
# Requires: Boot2docker installed
# Author: Manfred Touron (@moul)
local -a _1st_arguments
_1st_arguments=(
"init":"Create a new Boot2Docker VM."
"up":"Start VM from any states."
"start":"Start VM from any states."
"boot":"Start VM from any states."
"ssh":"[ssh-command] Login to VM via SSH."
"save":"Suspend VM and save state to disk."
"suspend":"Suspend VM and save state to disk."
"down":"Gracefully shutdown the VM."
"stop":"Gracefully shutdown the VM."
"halt":"Gracefully shutdown the VM."
"restart":"Gracefully reboot the VM."
"poweroff":"Forcefully power off the VM (may corrupt disk image)."
"reset":"Forcefully power cycle the VM (may corrupt disk image)."
"delete":"Delete Boot2Docker VM and its disk image."
"destroy":"Delete Boot2Docker VM and its disk image."
"config":"Show selected profile file settings."
"cfg":"Show selected profile file settings."
"info":"Display detailed information of VM."
"ip":"Display the IP address of the VM's Host-only network."
"socket":"Display the DOCKER_HOST socket to connect to."
"shellinit":"Display the shell command to set up the Docker client."
"status":"Display current state of VM."
"download":"Download Boot2Docker ISO image."
"upgrade":"Upgrade the Boot2Docker ISO image (restart if running)."
"version":"Display version information."
)
_arguments \
'(--basevmdk)--basevmdk[Path to VMDK to use as base for persistent partition]' \
'(--cpus)'{-c,--cpus}'[number of CPUs for boot2docker.]' \
'(--clobber)--clobber[overwrite Docker client binary on boot2docker upgrade]' \
'(--dhcp)--dhcp[enable VirtualBox host-only network DHCP.]' \
'(--dhcpip)--dhcpip[VirtualBox host-only network DHCP server address.]' \
'(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB).]' \
'(--dockerport)--dockerport[host Docker port (forward to port 2376 in VM). (deprecated - use with care)]' \
'(--driver)--driver[hypervisor driver.]' \
'(--force-upgrade-download)--force-upgrade-download[always download on boot2docker upgrade, never skip.]' \
'(--hostip)--hostip[VirtualBox host-only network IP address.]' \
'(--iso)--iso[path to boot2docker ISO image.]' \
'(--iso-url)--iso-url[/api.github.com/repos/boot2docker/boot2docker/releases": source URL to provision the boot2docker ISO image.]' \
'(--lowerip)--lowerip[VirtualBox host-only network DHCP lower bound.]' \
'(--memory)'{-m,--memory}'[virtual machine memory size (in MB).]' \
'(--netmask)--netmask[VirtualBox host-only network mask.]' \
'(--no-dummy)--no-dummy[Example parameter for the dummy driver.]' \
'(--retries)--retries[number of port knocking retries during 'start']' \
'(--serial)--serial[try serial console to get IP address (experimental)]' \
'(--serialfile)--serialfile[path to the serial socket/pipe.]' \
'(--ssh)--ssh[path to SSH client utility.]' \
'(--ssh-keygen)--ssh-keygen[path to ssh-keygen utility.]' \
'(--sshkey)--sshkey[path to SSH key to use.]' \
'(--sshport)--sshport[host SSH port (forward to port 22 in VM).]' \
'(--upperip)--upperip[VirtualBox host-only network DHCP upper bound.]' \
'(--vbm)--vbm[path to VirtualBox management utility.]' \
'(--vbox-share)--vbox-share[(defaults to "/Users=Users" if no shares are specified; use "disable" to explicitly prevent any shares from being created) List of directories to share during "up|start|boot" via VirtualBox Guest Additions, with optional labels]' \
'(--verbose)'{-v,--verbose}'[display verbose command invocations.]' \
'(--vm)--vm[virtual machine name.]' \
'(--waittime)--waittime[Time in milliseconds to wait between port knocking retries during 'start']' \
'*:: :->subcmds' && return 0
#_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "boot2docker command" _1st_arguments
return
fi

View file

@ -35,6 +35,7 @@ _1st_arguments=(
'info:information about a formula' 'info:information about a formula'
'install:install a formula' 'install:install a formula'
'reinstall:install a formula anew; re-using its current options' 'reinstall:install a formula anew; re-using its current options'
'leaves:show installed formulae that are not dependencies of another installed formula'
'link:link a formula' 'link:link a formula'
'list:list files in a formula or not-installed formulae' 'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula' 'log:git commit log for a formula'

View file

@ -1,2 +1,4 @@
alias brews='brew list -1' alias brews='brew list -1'
alias bubu="brew update && brew upgrade && brew cleanup" alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'

View file

@ -39,7 +39,7 @@ This will exclude the `foreman` and `spin` gems (i.e. their executable) from bei
## Excluded gems ## Excluded gems
These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification. These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification.
`berks` `berks`
`foreman` `foreman`

View file

@ -4,6 +4,7 @@ alias bp="bundle package"
alias bo="bundle open" alias bo="bundle open"
alias bu="bundle update" alias bu="bundle update"
alias bi="bundle_install" alias bi="bundle_install"
alias bcn="bundle clean"
bundled_commands=( bundled_commands=(
annotate annotate

View file

@ -17,13 +17,16 @@ function _cabal_commands() {
subcommand) subcommand)
subcommands=( subcommands=(
"bench:Run the benchmark, if any (configure with UserHooks)" "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" "check:Check the package for common mistakes"
"clean:Clean up after a build" "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" "configure:Prepare to build the package"
"exec:Run a command with the cabal environment"
"fetch:Downloads packages for later installation" "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" "help:Help about commands"
"hscolour:Generate HsColour colourised code, in HTML format" "hscolour:Generate HsColour colourised code, in HTML format"
"info:Display detailed information about a particular package" "info:Display detailed information about a particular package"
@ -31,7 +34,10 @@ function _cabal_commands() {
"install:Installs a list of packages" "install:Installs a list of packages"
"list:List packages matching a search string" "list:List packages matching a search string"
"register:Register this package with the compiler" "register:Register this package with the compiler"
"repl:Open an interpreter session for the given target"
"report:Upload build reports to a remote server" "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)" "sdist:Generate a source distribution file (.tar.gz)"
"test:Run the test suite, if any (configure with UserHooks)" "test:Run the test suite, if any (configure with UserHooks)"
"unpack:Unpacks packages for user inspection" "unpack:Unpacks packages for user inspection"
@ -45,3 +51,43 @@ function _cabal_commands() {
} }
compdef _cabal_commands cabal 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 }

View file

@ -0,0 +1,19 @@
# CakePHP 3 basic command completion
_cakephp3_get_command_list () {
cakephp3commands=($(bin/cake completion commands));printf "%s\n" "${cakephp3commands[@]}"
}
_cakephp3 () {
if [ -f bin/cake ]; then
compadd `_cakephp3_get_command_list`
fi
}
compdef _cakephp3 bin/cake
compdef _cakephp3 cake
#Alias
alias c3='bin/cake'
alias c3cache='bin/cake orm_cache clear'
alias c3migrate='bin/cake migrations migrate'

View file

@ -0,0 +1,5 @@
if which cask &> /dev/null; then
source $(dirname $(which cask))/../etc/cask_completion.zsh
else
print "zsh cask plugin: cask not found"
fi

1
plugins/chucknorris/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
fortunes/chucknorris.dat

View file

@ -0,0 +1,2 @@
License: GPL v2
Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.

View file

@ -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"

View file

@ -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.
%

31
plugins/coffee/README.md Normal file
View file

@ -0,0 +1,31 @@
## Coffeescript Plugin
This plugin provides aliases for quickly compiling and previewing your
cofeescript code.
When writing Coffeescript it's very common to want to preview the output of a
certain snippet of code, either because you want to test the output or because
you'd like to execute it in a browser console which doesn't accept Coffeescript.
Preview the compiled result of your coffeescript with `cf "code"` as per the
following:
```zsh
$ cf 'if a then be else c'
if (a) {
b;
} else {
c;
}
```
Also provides the following aliases:
* **cfc:** Copies the compiled JS to your clipboard. Very useful when you want
to run the code in a JS console.
* **cfp:** Compiles from your currently copied clipboard. Useful when you want
to compile large/multi-line snippets
* **cfpc:** Paste coffeescript from clipboard, compile to JS, then copy the
the result back to clipboard.

View file

@ -0,0 +1,16 @@
#!/bin/zsh
# compile a string of coffeescript and print to output
cf () {
coffee -peb $1
}
# compile & copy to clipboard
cfc () {
cf $1 | pbcopy
}
# compile from pasteboard & print
alias cfp='coffeeMe "$(pbpaste)"'
# compile from pasteboard and copy to clipboard
alias cfpc='cfp | pbcopy'

View file

@ -13,7 +13,7 @@ alias lS='ls -1FSsh'
alias lart='ls -1Fcart' alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt' alias lrt='ls -1Fcrt'
alias zshrc='vim ~/.zshrc' # Quick access to the ~/.zshrc file alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file
alias grep='grep --color' alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '

View file

@ -7,7 +7,7 @@
# Composer basic command completion # Composer basic command completion
_composer_get_command_list () { _composer_get_command_list () {
$_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^\s*[a-z]+/ { print $1 }' $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
} }
_composer_get_required_list () { _composer_get_required_list () {

View file

@ -9,8 +9,10 @@
# You can just set apt_pref='apt-get' to override it. # You can just set apt_pref='apt-get' to override it.
if [[ -e $( which -p aptitude 2>&1 ) ]]; then if [[ -e $( which -p aptitude 2>&1 ) ]]; then
apt_pref='aptitude' apt_pref='aptitude'
apt_upgr='safe-upgrade'
else else
apt_pref='apt-get' apt_pref='apt-get'
apt_upgr='upgrade'
fi fi
# Use sudo by default if it's installed # Use sudo by default if it's installed
@ -45,10 +47,10 @@ if [[ $use_sudo -eq 1 ]]; then
alias abd='sudo $apt_pref build-dep' alias abd='sudo $apt_pref build-dep'
alias ac='sudo $apt_pref clean' alias ac='sudo $apt_pref clean'
alias ad='sudo $apt_pref update' alias ad='sudo $apt_pref update'
alias adg='sudo $apt_pref update && sudo $apt_pref upgrade' alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr'
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade' alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
alias afu='sudo apt-file update' alias afu='sudo apt-file update'
alias ag='sudo $apt_pref upgrade' alias ag='sudo $apt_pref $apt_upgr'
alias ai='sudo $apt_pref install' alias ai='sudo $apt_pref install'
# Install all packages given on the command line while using only the first word of each line: # Install all packages given on the command line while using only the first word of each line:
# acs ... | ail # acs ... | ail
@ -80,10 +82,10 @@ else
} }
alias ac='su -ls \'$apt_pref clean\' root' alias ac='su -ls \'$apt_pref clean\' root'
alias ad='su -lc \'$apt_pref update\' root' alias ad='su -lc \'$apt_pref update\' root'
alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root' alias adg='su -lc \'$apt_pref update && aptitude $apt_upgr\' root'
alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root' alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root'
alias afu='su -lc "apt-file update"' alias afu='su -lc "apt-file update"'
alias ag='su -lc \'$apt_pref safe-upgrade\' root' alias ag='su -lc \'$apt_pref $apt_upgr\' root'
ai() { ai() {
cmd="su -lc 'aptitude -P install $@' root" cmd="su -lc 'aptitude -P install $@' root"
print "$cmd" print "$cmd"
@ -136,7 +138,7 @@ apt_pref_compdef abd "build-dep"
apt_pref_compdef ac "clean" apt_pref_compdef ac "clean"
apt_pref_compdef ad "update" apt_pref_compdef ad "update"
apt_pref_compdef afu "update" apt_pref_compdef afu "update"
apt_pref_compdef ag "upgrade" apt_pref_compdef ag "$apt_upgr"
apt_pref_compdef ai "install" apt_pref_compdef ai "install"
apt_pref_compdef ail "install" apt_pref_compdef ail "install"
apt_pref_compdef ap "purge" apt_pref_compdef ap "purge"

View file

@ -49,7 +49,8 @@ function push_future() {
} }
# Called by zsh when directory changes # Called by zsh when directory changes
function chpwd() { chpwd_functions+=(chpwd_dirhistory)
function chpwd_dirhistory() {
push_past $PWD push_past $PWD
# If DIRHISTORY_CD is not set... # If DIRHISTORY_CD is not set...
if [[ -z "${DIRHISTORY_CD+x}" ]]; then if [[ -z "${DIRHISTORY_CD+x}" ]]; then

View file

@ -11,7 +11,8 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
[[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
fi fi
chpwd() { chpwd_functions+=(chpwd_dirpersist)
chpwd_dirpersist() {
if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
local -ax my_stack local -ax my_stack
my_stack=( ${PWD} ${dirstack} ) my_stack=( ${PWD} ${dirstack} )

View file

@ -2,59 +2,114 @@
typeset -ga nul_args typeset -ga nul_args
nul_args=( nul_args=(
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))'
'--settings=-[the Python path to a settings module.]:file:_files' '--settings=-[the Python path to a settings module.]:file:_files'
'--pythonpath=-[a directory to add to the Python path.]::directory:_directories' '--pythonpath=-[a directory to add to the Python path.]:directory:_directories'
'--traceback[print traceback on exception.]' '--traceback[print traceback on exception.]'
"--no-color[Don't colorize the command output.]"
"--version[show program's version number and exit.]" "--version[show program's version number and exit.]"
{-h,--help}'[show this help message and exit.]' {-h,--help}'[show this help message and exit.]'
) )
_managepy-adminindex(){ typeset -ga start_args
start_args=(
'--template=-[The path or URL to load the template from.]:directory:_directories'
'--extension=-[The file extension(s) to render (default: "py").]'
'--name=-[The file name(s) to render.]:file:_files'
)
typeset -ga db_args
db_args=(
'--database=-[Nominates a database. Defaults to the "default" database.]'
)
typeset -ga noinput_args
noinput_args=(
'--noinput[tells Django to NOT prompt the user for input of any kind.]'
)
typeset -ga no_init_data_args
no_init_data_args=(
'--no-initial-data[Tells Django not to load any initial data after database synchronization.]'
)
typeset -ga tag_args
tag_args=(
'--tag=-[Run only checks labeled with given tag.]'
'--list-tags[List available tags.]'
)
_managepy-check(){
_arguments -s : \ _arguments -s : \
$nul_args \ $tag_args \
'*::directory:_directories' && ret=0 $nul_args && ret=0
}
_managepy-changepassword(){
_arguments -s : \
$db_args \
$nul_args && ret=0
} }
_managepy-createcachetable(){ _managepy-createcachetable(){
_arguments -s : \ _arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-createsuperuser(){
_arguments -s : \
'--username=-[Specifies the login for the superuser.]' \
'--email=-[Specifies the email for the superuser.]' \
$noinput_args \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-collectstatic(){ _managepy-collectstatic(){
_arguments -s : \ _arguments -s : \
'--link=-[Create a symbolic link to each file instead of copying.]:' \ '--link[Create a symbolic link to each file instead of copying.]' \
'--noinput=-[Do NOT prompt the user for input of any kind.]:' \ '--no-post-process[Do NOT post process collected files.]' \
'--no-post-process=-[Do NOT post process collected files.]:' \ '--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]' \
'--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]:' \ '--dry-run[Do everything except modify the filesystem.]' \
'--dry-run=-[Do everything except modify the filesystem.]:' \ '--clear[Clear the existing files using the storage before trying to copy or link the original file.]' \
'--clear=-[Clear the existing files using the storage before trying to copy or link the original file.]:' \ '--link[Create a symbolic link to each file instead of copying.]' \
'--link=-[Create a symbolic link to each file instead of copying.]:' \ '--no-default-ignore[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]' \
'--no-default-ignore=-[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]:' \ $noinput_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-dbshell(){ _managepy-dbshell(){
_arguments -s : \ _arguments -s : \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-diffsettings(){ _managepy-diffsettings(){
_arguments -s : \ _arguments -s : \
"--all[Display all settings, regardless of their value.]"
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-dumpdata(){ _managepy-dumpdata(){
_arguments -s : \ _arguments -s : \
'--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \ '--format=-[Specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
'--indent=-[specifies the indent level to use when pretty-printing output.]:' \ '--indent=-[Specifies the indent level to use when pretty-printing output.]' \
'--exclude=-[An app_label or app_label.ModelName to exclude (use multiple --exclude to exclude multiple apps/models).]' \
'--natural-foreign[Use natural foreign keys if they are available.]' \
'--natural-primary[Use natural primary keys if they are available.]' \
"--all[Use Django's base manager to dump all models stored in the database.]" \
'--pks=-[Only dump objects with given primary keys.]' \
$db_args \
$nul_args \ $nul_args \
'*::appname:_applist' && ret=0 '*::appname:_applist' && ret=0
} }
_managepy-flush(){ _managepy-flush(){
_arguments -s : \ _arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ $no_init_data_args \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \ $db_args \
$noinput_args \
$nul_args && ret=0 $nul_args && ret=0
} }
@ -75,32 +130,61 @@ _managepy_cmds(){
_managepy-inspectdb(){ _managepy-inspectdb(){
_arguments -s : \ _arguments -s : \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-loaddata(){ _managepy-loaddata(){
_arguments -s : \ _arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ '--ignorenonexistent[Ignores entries in the serialized data for fields that do not currently exist on the model.]' \
'--app=-[Only look for fixtures in the specified app.]:appname:_applist' \
'*::file:_files' \ '*::file:_files' \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-reset(){ _managepy-makemessages(){
_arguments -s : \ _arguments -s : \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \ '--locale=-[Creates or updates the message files for the given locale(s) (e.g. pt_BR).]' \
'*::appname:_applist' \ '--domain=-[The domain of the message files (default: "django").]' \
'--all[Updates the message files for all existing locales.]' \
'--extension=-[The file extension(s) to examine (default: "html,txt", or "js" if the domain is "djangojs").]' \
'--symlinks[Follows symlinks to directories when examining source code and templates for translation strings.]' \
'--ignore=-[Ignore files or directories matching this glob-style pattern.]' \
"--no-default-ignore[Don't ignore the common glob-style patterns 'CVS', '.*', '*~' and '*.pyc'.]" \
"--no-wrap[Don't break long message lines into several lines.]" \
"--no-location[Don't write '#: filename:line' lines.]" \
'--no-obsolete[emove obsolete message strings.]' \
'--keep-pot[Keep .pot file after making messages.]' \
$nul_args && ret=0
}
_managepy-makemigrations(){
_arguments -s : \
'--dry-run[Just show what migrations would be made]' \
'--merge[Enable fixing of migration conflicts.]' \
'--empty[Create an empty migration.]' \
$noinput_args \
$nul_args && ret=0
}
_managepy-migrate(){
_arguments -s : \
'--fake[Mark migrations as run without actually running them]' \
'--list[Show a list of all known migrations and which are applied]' \
$no_init_data_args \
$noinput_args \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-runfcgi(){ _managepy-runfcgi(){
local state local state
local fcgi_opts local fcgi_opts
fcgi_opts=( fcgi_opts=(
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)' 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
'host[hostname to listen on..]:' 'host[hostname to listen on..]:'
'port[port to listen on.]:' 'port[port to listen on.]:'
'socket[UNIX socket to listen on.]::file:_files' 'socket[UNIX socket to listen on.]:file:_files'
'method[prefork or threaded (default prefork)]:method:(prefork threaded)' 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:' 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
'maxspare[max number of spare processes / threads.]:' 'maxspare[max number of spare processes / threads.]:'
@ -112,7 +196,7 @@ _managepy-runfcgi(){
'outlog[write stdout to this file.]:file:_files' 'outlog[write stdout to this file.]:file:_files'
'errlog[write stderr to this file.]:file:_files' 'errlog[write stderr to this file.]:file:_files'
) )
_arguments -s : \ _arguments -s : \
$nul_args \ $nul_args \
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0 '*: :_values "FCGI Setting" $fcgi_opts' && ret=0
@ -120,72 +204,148 @@ _managepy-runfcgi(){
_managepy-runserver(){ _managepy-runserver(){
_arguments -s : \ _arguments -s : \
'--noreload[tells Django to NOT use the auto-reloader.]' \ '--ipv6[Tells Django to use an IPv6 address.]' \
'--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \ '--nothreading[Tells Django to NOT use threading.]' \
'--noreload[Tells Django to NOT use the auto-reloader.]' \
'--nostatic[Tells Django to NOT automatically serve static files at STATIC_URL.]' \
'--insecure[Allows serving static files even if DEBUG is False.]' \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-shell(){ _managepy-shell(){
_arguments -s : \ _arguments -s : \
'--plain[tells Django to use plain Python, not IPython.]' \ '--plain[Tells Django to use plain Python, not IPython.]' \
'--no-startup[When using plain Python, ignore the PYTHONSTARTUP environment variable and ~/.pythonrc.py script.]' \
'--interface=-[Specify an interactive interpreter interface.]:INTERFACE:((ipython bpython))' \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-sql(){} _managepy-sql(){
_managepy-sqlall(){} _arguments -s : \
_managepy-sqlclear(){} $db_args \
_managepy-sqlcustom(){} $nul_args && ret=0
_managepy-sqlflush(){} }
_managepy-sqlindexes(){}
_managepy-sqlinitialdata(){} _managepy-sqlall(){
_managepy-sqlreset(){} _arguments -s : \
_managepy-sqlsequencereset(){} $db_args \
_managepy-startapp(){} $nul_args && ret=0
_managepy-startproject(){} }
_managepy-sqlclear(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-sqlcustom(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-dropindexes(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-sqlflush(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-sqlindexes(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-sqlinitialdata(){
_arguments -s : \
$nul_args && ret=0
}
_managepy-sqlsequencereset(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-squashmigrations(){
_arguments -s : \
'--no-optimize[Do not try to optimize the squashed operations.]' \
$noinput_args \
$nul_args && ret=0
}
_managepy-startapp(){
_arguments -s : \
$start_args \
$nul_args && ret=0
}
_managepy-startproject(){
_arguments -s : \
$start_args \
$nul_args && ret=0
}
_managepy-syncdb() { _managepy-syncdb() {
_arguments -s : \ _arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ $noinput_args \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \ $no_init_data_args \
$db_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-test() { _managepy-test() {
_arguments -s : \ _arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ '--failfast[Tells Django to stop running the test suite after first failed test.]' \
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \ '--testrunner=-[Tells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting.]' \
'--liveserver=-[Overrides the default address where the live server (used with LiveServerTestCase) is expected to run from. The default value is localhost:8081.]' \
'--top-level-directory=-[Top level of project for unittest discovery.]' \
'--pattern=-[The test matching pattern. Defaults to test*.py.]:' \
$noinput_args \
'*::appname:_applist' \ '*::appname:_applist' \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-testserver() { _managepy-testserver() {
_arguments -s : \ _arguments -s : \
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
'--addrport=-[port number or ipaddr:port to run the server on.]' \ '--addrport=-[port number or ipaddr:port to run the server on.]' \
'--ipv6[Tells Django to use an IPv6 address.]' \
$noinput_args \
'*::fixture:_files' \ '*::fixture:_files' \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-validate() { _managepy-validate() {
_arguments -s : \ _arguments -s : \
$tag_args \
$nul_args && ret=0 $nul_args && ret=0
} }
_managepy-commands() { _managepy-commands() {
local -a commands local -a commands
commands=( commands=(
'adminindex:prints the admin-index template snippet for the given app name(s).' "changepassword:Change a user's password for django.contrib.auth."
'createcachetable:creates the table needed to use the SQL cache backend.' 'check:Checks the entire Django project for potential problems.'
'compilemessages:Compiles .po files to .mo files for use with builtin gettext support.'
'createcachetable:Creates the table needed to use the SQL cache backend.'
'createsuperuser:Used to create a superuser.'
'collectstatic:Collect static files in a single location.' 'collectstatic:Collect static files in a single location.'
'dbshell:runs the command-line client for the current DATABASE_ENGINE.' 'dbshell:Runs the command-line client for the current DATABASE_ENGINE.'
"diffsettings:displays differences between the current settings.py and Django's default settings." "diffsettings:Displays differences between the current settings.py and Django's default settings."
'dumpdata:Output the contents of the database as a fixture of the given format.' 'dumpdata:Output the contents of the database as a fixture of the given format.'
'flush:Executes ``sqlflush`` on the current database.' 'flush:Executes ``sqlflush`` on the current database.'
'help:manage.py help.' 'help:manage.py help.'
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.' 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
'loaddata:Installs the named fixture(s) in the database.' 'loaddata:Installs the named fixture(s) in the database.'
'reset:Executes ``sqlreset`` for the given app(s) in the current database.' 'makemessages:Runs over the entire source tree of the current directory and pulls out all strings marked for translation.'
'makemigrations:Creates new migration(s) for apps.'
'migrate:Updates database schema. Manages both apps with migrations and those without.'
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,' 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
'runserver:Starts a lightweight Web server for development.' 'runserver:Starts a lightweight Web server for development.'
'shell:Runs a Python interactive interpreter.' 'shell:Runs a Python interactive interpreter.'
@ -193,11 +353,12 @@ _managepy-commands() {
'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).' 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).' 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).' 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
'sqldropindexes:Prints the DROP INDEX SQL statements for the given model module name(s).'
'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.' 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).' 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
"sqlinitialdata:RENAMED: see 'sqlcustom'" "sqlinitialdata:RENAMED: see 'sqlcustom'"
'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).' 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
'squashmigrations:Squashes an existing set of migrations (from first until specified) into a single new one.'
"startapp:Creates a Django app directory structure for the given app name in this project's directory." "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." "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." "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
@ -205,7 +366,7 @@ _managepy-commands() {
'testserver:Runs a development server with data from the given fixture(s).' 'testserver:Runs a development server with data from the given fixture(s).'
'validate:Validates all installed models.' 'validate:Validates all installed models.'
) )
_describe -t commands 'manage.py command' commands && ret=0 _describe -t commands 'manage.py command' commands && ret=0
} }
@ -223,7 +384,7 @@ _applist() {
_managepy() { _managepy() {
local curcontext=$curcontext ret=1 local curcontext=$curcontext ret=1
if ((CURRENT == 2)); then if ((CURRENT == 2)); then
_managepy-commands _managepy-commands
else else

View file

@ -0,0 +1,5 @@
# Docker-compose plugin for oh my zsh
A copy of the completion script from the [docker-compose](1) git repo.
[1]:[https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose]

View file

@ -0,0 +1,308 @@
#compdef docker-compose
# Description
# -----------
# zsh completion for docker-compose
# https://github.com/sdurrheimer/docker-compose-zsh-completion
# -------------------------------------------------------------------------
# Version
# -------
# 0.1.0
# -------------------------------------------------------------------------
# Authors
# -------
# * Steve Durrheimer <s.durrheimer@gmail.com>
# -------------------------------------------------------------------------
# Inspiration
# -----------
# * @albers docker-compose bash completion script
# * @felixr docker zsh completion script : https://github.com/felixr/docker-zsh-completion
# -------------------------------------------------------------------------
# For compatibility reasons, Compose and therefore its completion supports several
# stack compositon files as listed here, in descending priority.
# Support for these filenames might be dropped in some future version.
__docker-compose_compose_file() {
local file
for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
[ -e $file ] && {
echo $file
return
}
done
echo docker-compose.yml
}
# Extracts all service names from docker-compose.yml.
___docker-compose_all_services_in_compose_file() {
local already_selected
local -a services
already_selected=$(echo ${words[@]} | tr " " "|")
awk -F: '/^[a-zA-Z0-9]/{print $1}' "${compose_file:-$(__docker-compose_compose_file)}" 2>/dev/null | grep -Ev "$already_selected"
}
# All services, even those without an existing container
__docker-compose_services_all() {
services=$(___docker-compose_all_services_in_compose_file)
_alternative "args:services:($services)"
}
# All services that have an entry with the given key in their docker-compose.yml section
___docker-compose_services_with_key() {
local already_selected
local -a buildable
already_selected=$(echo ${words[@]} | tr " " "|")
# flatten sections to one line, then filter lines containing the key and return section name.
awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' "${compose_file:-$(__docker-compose_compose_file)}" 2>/dev/null | awk -F: -v key=": +$1:" '$0 ~ key {print $1}' 2>/dev/null | grep -Ev "$already_selected"
}
# All services that are defined by a Dockerfile reference
__docker-compose_services_from_build() {
buildable=$(___docker-compose_services_with_key build)
_alternative "args:buildable services:($buildable)"
}
# All services that are defined by an image
__docker-compose_services_from_image() {
pullable=$(___docker-compose_services_with_key image)
_alternative "args:pullable services:($pullable)"
}
__docker-compose_get_services() {
local kind expl
declare -a running stopped lines args services
docker_status=$(docker ps > /dev/null 2>&1)
if [ $? -ne 0 ]; then
_message "Error! Docker is not running."
return 1
fi
kind=$1
shift
[[ $kind = (stopped|all) ]] && args=($args -a)
lines=(${(f)"$(_call_program commands docker ps ${args})"})
services=(${(f)"$(_call_program commands docker-compose 2>/dev/null ${compose_file:+-f $compose_file} ${compose_project:+-p $compose_project} ps -q)"})
# Parse header line to find columns
local i=1 j=1 k header=${lines[1]}
declare -A begin end
while (( $j < ${#header} - 1 )) {
i=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 1))
j=$(( $i + ${${header[$i,-1]}[(i) ]} - 1))
k=$(( $j + ${${header[$j,-1]}[(i)[^ ]]} - 2))
begin[${header[$i,$(($j-1))]}]=$i
end[${header[$i,$(($j-1))]}]=$k
}
lines=(${lines[2,-1]})
# Container ID
local line s name
local -a names
for line in $lines; do
if [[ $services == *"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"* ]]; then
names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}})
for name in $names; do
s="${${name%_*}#*_}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"
s="$s, ${${${line[$begin[IMAGE],$end[IMAGE]]}/:/\\:}%% ##}"
if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
stopped=($stopped $s)
else
running=($running $s)
fi
done
fi
done
[[ $kind = (running|all) ]] && _describe -t services-running "running services" running
[[ $kind = (stopped|all) ]] && _describe -t services-stopped "stopped services" stopped
}
__docker-compose_stoppedservices() {
__docker-compose_get_services stopped "$@"
}
__docker-compose_runningservices() {
__docker-compose_get_services running "$@"
}
__docker-compose_services () {
__docker-compose_get_services all "$@"
}
__docker-compose_caching_policy() {
oldp=( "$1"(Nmh+1) ) # 1 hour
(( $#oldp ))
}
__docker-compose_commands () {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker-compose_caching_policy
fi
if ( [[ ${+_docker_compose_subcommands} -eq 0 ]] || _cache_invalid docker_compose_subcommands) \
&& ! _retrieve_cache docker_compose_subcommands;
then
local -a lines
lines=(${(f)"$(_call_program commands docker-compose 2>&1)"})
_docker_compose_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
_store_cache docker_compose_subcommands _docker_compose_subcommands
fi
_describe -t docker-compose-commands "docker-compose command" _docker_compose_subcommands
}
__docker-compose_subcommand () {
local -a _command_args
integer ret=1
case "$words[1]" in
(build)
_arguments \
'--no-cache[Do not use cache when building the image]' \
'*:services:__docker-compose_services_from_build' && ret=0
;;
(help)
_arguments ':subcommand:__docker-compose_commands' && ret=0
;;
(kill)
_arguments \
'-s[SIGNAL to send to the container. Default signal is SIGKILL.]:signal:_signals' \
'*:running services:__docker-compose_runningservices' && ret=0
;;
(logs)
_arguments \
'--no-color[Produce monochrome output.]' \
'*:services:__docker-compose_services_all' && ret=0
;;
(migrate-to-labels)
_arguments \
'(-):Recreate containers to add labels' && ret=0
;;
(port)
_arguments \
'--protocol=-[tcp or udap (defaults to tcp)]:protocol:(tcp udp)' \
'--index=-[index of the container if there are mutiple instances of a service (defaults to 1)]:index: ' \
'1:running services:__docker-compose_runningservices' \
'2:port:_ports' && ret=0
;;
(ps)
_arguments \
'-q[Only display IDs]' \
'*:services:__docker-compose_services_all' && ret=0
;;
(pull)
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
'*:services:__docker-compose_services_from_image' && ret=0
;;
(rm)
_arguments \
'(-f --force)'{-f,--force}"[Don't ask to confirm removal]" \
'-v[Remove volumes associated with containers]' \
'*:stopped services:__docker-compose_stoppedservices' && ret=0
;;
(run)
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
'-d[Detached mode: Run container in the background, print new container name.]' \
'--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
'*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \
'(-u --user)'{-u,--user=-}'[Run as specified username or uid]:username or uid:_users' \
"--no-deps[Don't start linked services.]" \
'--rm[Remove container after run. Ignored in detached mode.]' \
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
'-T[Disable pseudo-tty allocation. By default `docker-compose run` allocates a TTY.]' \
'(-):services:__docker-compose_services' \
'(-):command: _command_names -e' \
'*::arguments: _normal' && ret=0
;;
(scale)
_arguments '*:running services:__docker-compose_runningservices' && ret=0
;;
(start)
_arguments '*:stopped services:__docker-compose_stoppedservices' && ret=0
;;
(stop|restart)
_arguments \
'(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
'*:running services:__docker-compose_runningservices' && ret=0
;;
(up)
_arguments \
'--allow-insecure-ssl[Allow insecure connections to the docker registry]' \
'-d[Detached mode: Run containers in the background, print new container names.]' \
'--no-color[Produce monochrome output.]' \
"--no-deps[Don't start linked services.]" \
"--no-recreate[If containers already exist, don't recreate them.]" \
"--no-build[Don't build an image, even if it's missing]" \
'(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
"--x-smart-recreate[Only recreate containers whose configuration or image needs to be updated. (EXPERIMENTAL)]" \
'*:services:__docker-compose_services_all' && ret=0
;;
(version)
_arguments \
"--short[Shows only Compose's version number.]" && ret=0
;;
(*)
_message 'Unknown sub command'
esac
return ret
}
_docker-compose () {
# Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`.
# Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`.
if [[ $service != docker-compose ]]; then
_call_function - _$service
return
fi
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(- :)'{-h,--help}'[Get help]' \
'--verbose[Show more output]' \
'(- :)'{-v,--version}'[Print version and exit]' \
'(-f --file)'{-f,--file}'[Specify an alternate docker-compose file (default: docker-compose.yml)]:file:_files -g "*.yml"' \
'(-p --project-name)'{-p,--project-name}'[Specify an alternate project name (default: directory name)]:project name:' \
'(-): :->command' \
'(-)*:: :->option-or-argument' && ret=0
local counter=1
#local compose_file compose_project
while [ $counter -lt ${#words[@]} ]; do
case "${words[$counter]}" in
-f|--file)
(( counter++ ))
compose_file="${words[$counter]}"
;;
-p|--project-name)
(( counter++ ))
compose_project="${words[$counter]}"
;;
*)
;;
esac
(( counter++ ))
done
case $state in
(command)
__docker-compose_commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:docker-compose-$words[1]:
__docker-compose_subcommand && ret=0
;;
esac
return ret
}
_docker-compose "$@"

View file

@ -11,8 +11,17 @@
# Output a selectable list of all running docker containers # Output a selectable list of all running docker containers
__docker_containers() { __docker_containers() {
declare -a cont_cmd 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 if [[ 'X$cont_cmd' != 'X' ]]
_describe 'containers' cont_cmd
}
# Output a selectable list of all containers, even not running
__docker_all_containers() {
declare -a cont_cmd
cont_cmd=($(docker ps -a | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
if [[ 'X$cont_cmd' != 'X' ]]
_describe 'containers' cont_cmd
} }
# output a selectable list of all docker images # output a selectable list of all docker images
@ -27,7 +36,7 @@ __docker_images() {
# --------------------------- # ---------------------------
__attach() { __attach() {
_arguments \ _arguments \
'--no-stdin[Do not attach stdin]' \ '--no-stdin[Do not attach STDIN]' \
'--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]' '--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]'
__docker_containers __docker_containers
} }
@ -43,21 +52,64 @@ __build() {
__commit() { __commit() {
_arguments \ _arguments \
'(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith <hannibal@a-team.com>"]' \ '(-a,--author=)'{-a,--author=}'[Author (e.g. "John Hannibal Smith <hannibal@a-team.com>")]' \
'(-c,--change=)'{-c,--change=}'[Apply Dockerfile instruction to the created image]' \
'(-m,--message=)'{-m,--message=}'[Commit message]' \ '(-m,--message=)'{-m,--message=}'[Commit message]' \
'--run=[Config automatically applied when the image is run.]' '(-p,--pause=)'{-p,--pause=}'[Pause container during commit]' \
__docker_containers
} }
__cp() { __cp() {
__docker_containers __docker_containers
} }
__create() {
_arguments \
'(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
'(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \
'--add-host=[Add a custom host-to-IP mapping]' \
'--cap-add=[Add Linux capabilities]' \
'--cap-drop=[Drop Linux capabilities]' \
'--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \
'(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \
'--cidfile=[Write the container ID to the file]' \
'--device=[Add a host device to the container]' \
'--dns=[Set custom dns servers]' \
'--dns-search=[Set custom DNS search domains]' \
'(-e,--env=)'{-e,--env=}'[Set environment variables]' \
'--env-file=[Read in a file of environment variables]' \
'--entrypoint=[Overwrite the default entrypoint of the image]' \
'--expose=[Expose a port from the container without publishing it to your host]' \
'(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
'(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
'--ipc=[IPC namespace to use]' \
'(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \
'--link=[Add link to another container (name:alias)]' \
'--log-driver=[Logging driver for the container]' \
'--lxc-conf=[Add custom LXC options]' \
'--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \
'(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
'--net=[Set the Network mode for the container]' \
'--name=[Assign a name to the container]' \
'--pid=[PID namespace to use]' \
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \
'--privileged=[Give extended privileges to this container]' \
'--restart=[Restart policy to apply when a container exits]' \
'--security-opt=[Security Options]' \
'--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
'(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
'(-u,--user=)'{-u,--user=}'[Username or UID]' \
'--ulimit=[Ulimit options]' \
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \
'--volumes-from=[Mount volumes from the specified container(s)]' \
'(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
__docker_images
}
__diff() { __diff() {
__docker_containers __docker_containers
} }
__events() { __events() {
_arguments \ _arguments \
'--since=[Show previously created events and then stream.]' '--since=[Show previously created events and then stream.]'
} }
@ -91,17 +143,14 @@ __info() {
# no arguments # no arguments
} }
__insert() {
__docker_images
_arguments '*:files:_files'
}
__inspect() { __inspect() {
__docker_images __docker_images
__docker_containers __docker_all_containers
} }
__kill() { __kill() {
_arguments \
'(-s,--signal=)'{-s,--signal=}'[KILL Signal]'
__docker_containers __docker_containers
} }
@ -162,7 +211,7 @@ __rm() {
'(-f,--force=)'{-f,--force=}'[Force removal of running container]' \ '(-f,--force=)'{-f,--force=}'[Force removal of running container]' \
'(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \ '(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \
'(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]' '(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]'
__docker_containers __docker_all_containers
} }
__rmi() { __rmi() {
@ -174,28 +223,43 @@ __rmi() {
__run() { __run() {
_arguments \ _arguments \
'(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \ '(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
'(-a,--attach=)'{-a,--attach=}'[Attach to stdin, stdout or stderr.]' \ '(-a,--attach=)'{-a,--attach=}'[Attach to STDIN, STDOUT or STDERR]' \
'(-c,--cpu-shares=)'{-c,--cpu-shares=}': CPU shares (relative weight)]' \ '--add-host=[Add a custom host-to-IP mapping]' \
'--cap-add=[Add Linux capabilities]' \
'--cap-drop=[Drop Linux capabilities]' \
'--cpuset-cpus=[CPUs in which to allow execution (0-3, 0,1)]' \
'(-c,--cpu-shares=)'{-c,--cpu-shares=}'[CPU shares (relative weight)]' \
'--cidfile=[Write the container ID to the file]' \ '--cidfile=[Write the container ID to the file]' \
'(-d,--detach=)'{-d,--detach=}'[Detached mode: Run container in the background, print new container id]' \ '(-d,--detach=)'{-d,--detach=}'[Run container in the background, print new container id]' \
'--device=[Add a host device to the container]' \
'--dns=[Set custom dns servers]' \ '--dns=[Set custom dns servers]' \
'--dns-search=[Set custom DNS search domains]' \
'(-e,--env=)'{-e,--env=}'[Set environment variables]' \ '(-e,--env=)'{-e,--env=}'[Set environment variables]' \
'--env-file=[Read in a file of environment variables]' \
'--entrypoint=[Overwrite the default entrypoint of the image]' \ '--entrypoint=[Overwrite the default entrypoint of the image]' \
'--expose=[Expose a port from the container without publishing it to your host]' \ '--expose=[Expose a port from the container without publishing it to your host]' \
'(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \ '(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
'(-i,--interactive=)'{-i,--interactive=}'[Keep stdin open even if not attached]' \ '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
'--ipc=[IPC namespace to use]' \
'(-l,--label=)'{-l,--label=}'[Set meta data on a container]' \
'--link=[Add link to another container (name:alias)]' \ '--link=[Add link to another container (name:alias)]' \
'--lxc-conf=[Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"]' \ '--log-driver=[Logging driver for the container]' \
'--lxc-conf=[Add custom LXC options]' \
'--mac-address=[Container MAC address (e.g. 92:d0:c6:0a:29:33)]' \
'(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \ '(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
'(-n,--networking=)'{-n,--networking=}'[Enable networking for this container]' \ '--net=[Set the Network mode for the container]' \
'--name=[Assign a name to the container]' \ '--name=[Assign a name to the container]' \
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use "docker port" to see the actual mapping)]' \ '--pid=[PID namespace to use]' \
'(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort/protocol)]' \
'--privileged=[Give extended privileges to this container]' \ '--privileged=[Give extended privileges to this container]' \
'--restart=[Restart policy to apply when a container exits]' \
'--rm=[Automatically remove the container when it exits (incompatible with -d)]' \ '--rm=[Automatically remove the container when it exits (incompatible with -d)]' \
'--security-opt=[Security Options]' \
'--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \ '--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
'(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \ '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
'(-u,--user=)'{-u,--user=}'[Username or UID]' \ '(-u,--user=)'{-u,--user=}'[Username or UID]' \
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \ '--ulimit=[Ulimit options]' \
'(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. -v /host:/container or -v /container)]' \
'--volumes-from=[Mount volumes from the specified container(s)]' \ '--volumes-from=[Mount volumes from the specified container(s)]' \
'(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]' '(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
__docker_images __docker_images
@ -214,8 +278,12 @@ __save() {
__start() { __start() {
_arguments \ _arguments \
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \ '(-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_all_containers
}
__stats() {
__docker_containers __docker_containers
} }
@ -256,6 +324,7 @@ _1st_arguments=(
"build":"Build a container from a Dockerfile" "build":"Build a container from a Dockerfile"
"commit":"Create a new image from a container's changes" "commit":"Create a new image from a container's changes"
"cp":"Copy files/folders from the containers filesystem to the host path" "cp":"Copy files/folders from the containers filesystem to the host path"
"create":"Create new container without running it"
"diff":"Inspect changes on a container's filesystem" "diff":"Inspect changes on a container's filesystem"
"events":"Get real time events from the server" "events":"Get real time events from the server"
"export":"Stream the contents of a container as a tar archive" "export":"Stream the contents of a container as a tar archive"
@ -263,7 +332,6 @@ _1st_arguments=(
"images":"List images" "images":"List images"
"import":"Create a new filesystem image from the contents of a tarball" "import":"Create a new filesystem image from the contents of a tarball"
"info":"Display system-wide information" "info":"Display system-wide information"
"insert":"Insert a file in an image"
"inspect":"Return low-level information on a container" "inspect":"Return low-level information on a container"
"kill":"Kill a running container" "kill":"Kill a running container"
"load":"Load an image from a tar archive" "load":"Load an image from a tar archive"
@ -280,6 +348,7 @@ _1st_arguments=(
"save":"Save an image to a tar archive" "save":"Save an image to a tar archive"
"search":"Search for an image in the docker index" "search":"Search for an image in the docker index"
"start":"Start a stopped container" "start":"Start a stopped container"
"stats":"Display a live stream of one or more containers' resource usage statistics"
"stop":"Stop a running container" "stop":"Stop a running container"
"tag":"Tag an image into a repository" "tag":"Tag an image into a repository"
"top":"Lookup the running processes of a container" "top":"Lookup the running processes of a container"
@ -305,6 +374,8 @@ case "$words[1]" in
__commit ;; __commit ;;
cp) cp)
__cp ;; __cp ;;
create)
__create ;;
diff) diff)
__diff ;; __diff ;;
events) events)
@ -319,8 +390,6 @@ case "$words[1]" in
__import ;; __import ;;
info) info)
__info ;; __info ;;
insert)
__insert ;;
inspect) inspect)
__inspect ;; __inspect ;;
kill) kill)
@ -351,6 +420,8 @@ case "$words[1]" in
__save ;; __save ;;
search) search)
__search ;; __search ;;
stats)
__stats ;;
start) start)
__start ;; __start ;;
stop) stop)

View file

@ -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'

View file

@ -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'

135
plugins/emoji/README.md Normal file
View file

@ -0,0 +1,135 @@
# emoji plugin
Support for conveniently working with Unicode emoji in Zsh.
## Features
This plugin provides support for working with Unicode emoji characters in `zsh` using human-readable identifiers. It provides global variables which map emoji names to the actual characters, country names to their flags, and some named groupings of emoji. It also provides associated functions for displaying them.
#### Variables
Variable | Description
----------------- | --------------------------------
$emoji | Maps emoji names to characters
$emoji_flags | Maps country names to flag characters (using region indicators)
$emoji_groups | Named groups of emoji. Keys are group names; values are whitespace-separated lists of character names
You may define new emoji groups at run time by modifying `$emoji_groups`. The special group name `all` is reserved for use by the plugin. You should not modify `$emoji` or `$emoji_flags`.
#### Functions
Function | Description
---------------- | -------------------------------
random_emoji | Prints a random emoji character
display_emoji | Displays emoji, along with their names
## Usage and Examples
To output a specific emoji, use:
```
$> echo $emoji[<name>]
```
E.g.:
```
$> echo $emoji[mouse_face]
```
To output a random emoji, use:
```
$> random_emoji
```
To output a random emoji from a particular group, use:
```
$> random_emoji <group>
```
E.g.:
```
$> random_emoji fruits
$> random_emoji animals
$> random_emoji vehicles
$> random_emoji faces
```
The defined group names can be found with `echo ${(k)emoji_groups}`.
To list all available emoji with their names, use:
```
$> display_emoji
$> display_emoji fruits
$> display_emoji animals
$> display_emoji vehicles
$> display_emoji faces
```
To use emoji in a prompt:
```
PROMPT="$emoji[penguin] > ""
PROMPT='$(random_emoji fruits) > '
surfer=$emoji[surfer]
PROMPT="$surfer > "
```
## Technical Details
The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at http://www.unicode.org/reports/tr51/index.html.
The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke)
The values in the `$emoji*` maps are the emoji characters themselves, not escape sequences or other forms that require interpretation. They can be used in any context and do not require escape sequence support from commands like `echo` or `print`.
The emoji in the main `$emoji` map are standalone character sequences which can all be output on their own, without worrying about combining characters. The values may actually be multi-code-point sequences, instead of a single code point, and may include combining characters in those sequences. But they're arranged so their effects do not extend beyond that sequence.
The exception to this is the skin tone variation selectors. These are included in the main `$emoji` map because they can be displayed on their own, as well as used as combining characters. (If they follow a character that is not one of the emoji characters they combine with, they are displayed as color swatches.)
## Experimental Features
This defines some additional variables and functions, but these are experimental and subject to change at any time. You shouldn't rely on them being available. They're mostly for the use of emoji plugin developers to help decide what to include in future revisions.
Variables:
Variable | Description
----------------- | --------------------------------
$emoji2 | Auxiliary and combining characters
$emoji_skintone | Skin tone modifiers (from Unicode 8.0)
#### Skin Tone Variation Selection
This includes experimental support for the skin tone Variation Selectors introduced with Unicode 8.0, which let you select different skin tones for emoji involving humans.
NOTE: This really is experimental. The skin tone selectors are a relatively new feature and may not be supported by all systems. And the support in this plugin is a work in progress. It may not work in all places. In fact, I haven't gotten it to work anywhere yet. -apjanke
The "variation selectors" are combining characters which change the appearance of the preceding character. A variation selector character can be output immediately following a human emoji to change its skin tone color. You can also output a variation selector on its own to display a color swatch of that skin tone.
The `$emoji_skintone` associative array maps skin tone IDs to the variation selector characters. To use one, output it immediately following a smiley or other human emoji.
```
echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]"
```
Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](http://www.unicode.org/reports/tr51/index.html#Diversity) for details.
## TODO
These are things that could be enhanced in future revisions of the plugin.
* Incorporate CLDR data for ordering and groupings
* Short :bracket: style names (from gemoji)
* Incorporate `gemoji` data
* Country codes for flags
* ZWJ combining function?
#### Gemoji support
The [gemoji project](https://github.com/github/gemoji) seems to be the de facto main source for short names and other emoji-related metadata that isn't included in the official Unicode reports. (I'm saying this just from looking at the google results for "emoji short names" and related searches. -apjanke)
If this plugin is updated to provide short names, CLDR sorting data, and similar stuff, it should probably be changed to use the Gemoji project, and the `update_emoji.pl` script be rewritten in Ruby so it can use the Gemoji library directly instead of parsing its data files.
This does *not* mean that it should use Gemoji at run time. None of the `zsh` plugin stuff should call Gemoji or Ruby code. Rather, the "build time" `update_emoji.pl` script should be rewritten to use Gemoji to generate a pure-native-`zsh` character definition file which would be checked in to the repo and can be called by OMZ users without having Gemoji installed.
#### ZWJ combining function
One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](http://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences).
These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears.

File diff suppressed because it is too large Load diff

1308
plugins/emoji/emoji-data.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,289 @@
# emoji plugin
#
# Makes emoji support available within ZSH
#
# See the README for documentation.
_omz_emoji_plugin_dir="${0:h}"
() {
local LC_ALL=en_US.UTF-8
typeset -gAH emoji_groups
typeset -gAH emoji_con
typeset -gAH emoji2
typeset -gAH emoji_skintone
source "$_omz_emoji_plugin_dir/emoji-char-definitions.zsh"
unset _omz_emoji_plugin_dir
# These additional emoji are not in the definition file, but are useful in conjunction with it
# This is a combinin character that can be placed after any other character to surround
# it in a "keycap" symbol.
# The digits 0-9 are already in the emoji table as keycap_digit_<N>, keycap_ten, etc.
# It's unclear whether this should be in the $emoji array, because those characters are all ones
# which can be displayed on their own.
#emoji[combining_enclosing_keycap]="\U20E3"
emoji[regional_indicator_symbol_letter_d_regional_indicator_symbol_letter_e]=$'\xF0\x9F\x87\xA9\xF0\x9F\x87\xAA'
emoji[regional_indicator_symbol_letter_g_regional_indicator_symbol_letter_b]=$'\xF0\x9F\x87\xAC\xF0\x9F\x87\xA7'
emoji[regional_indicator_symbol_letter_c_regional_indicator_symbol_letter_n]=$'\xF0\x9F\x87\xA8\xF0\x9F\x87\xB3'
emoji[regional_indicator_symbol_letter_j_regional_indicator_symbol_letter_p]=$'\xF0\x9F\x87\xAF\xF0\x9F\x87\xB5'
emoji[regional_indicator_symbol_letter_k_regional_indicator_symbol_letter_r]=$'\xF0\x9F\x87\xB0\xF0\x9F\x87\xB7'
emoji[regional_indicator_symbol_letter_f_regional_indicator_symbol_letter_r]=$'\xF0\x9F\x87\xAB\xF0\x9F\x87\xB7'
emoji[regional_indicator_symbol_letter_e_regional_indicator_symbol_letter_s]=$'\xF0\x9F\x87\xAA\xF0\x9F\x87\xB8'
emoji[regional_indicator_symbol_letter_i_regional_indicator_symbol_letter_t]=$'\xF0\x9F\x87\xAE\xF0\x9F\x87\xB9'
emoji[regional_indicator_symbol_letter_u_regional_indicator_symbol_letter_s]=$'\xF0\x9F\x87\xBA\xF0\x9F\x87\xB8'
emoji[regional_indicator_symbol_letter_r_regional_indicator_symbol_letter_u]=$'\xF0\x9F\x87\xB7\xF0\x9F\x87\xBA'
# Nonstandard alias names
emoji[vulcan_salute]=$'\U1F596'
# Emoji combining and auxiliary characters
# "Variation Selectors" for controlling text vs emoji style presentation
# These apply to the immediately preceding character
emoji2[text_style]=$'\UFE0E'
emoji2[emoji_style]=$'\UFE0F'
# Joiner that indicates a single combined-form glyph (ligature) should be used
emoji2[zero_width_joiner]=$'\U200D'
# Skin tone modifiers
emoji2[emoji_modifier_fitzpatrick_type_1_2]=$'\U1F3FB'
emoji2[emoji_modifier_fitzpatrick_type_3]=$'\U1F3FC'
emoji2[emoji_modifier_fitzpatrick_type_4]=$'\U1F3FD'
emoji2[emoji_modifier_fitzpatrick_type_5]=$'\U1F3FE'
emoji2[emoji_modifier_fitzpatrick_type_6]=$'\U1F3FF'
# Various other combining characters. (Incomplete list; I selected ones that sound useful)
emoji2[combining_enclosing_circle]=$'\U20DD'
emoji2[combining_enclosing_square]=$'\U20DE'
emoji2[combining_enclosing_diamond]=$'\U20DF'
emoji2[combining_enclosing_circle_backslash]=$'\U20E0'
emoji2[combining_enclosing_screen]=$'\U20E2'
emoji2[combining_enclosing_keycap]=$'\U20E3'
emoji2[combining_enclosing_upward_pointing_triangle]=$'\U20E4'
# Easier access to skin tone modifiers
emoji_skintone[1_2]=$'\U1F3FB'
emoji_skintone[3]=$'\U1F3FC'
emoji_skintone[4]=$'\U1F3FD'
emoji_skintone[5]=$'\U1F3FE'
emoji_skintone[6]=$'\U1F3FF'
# Emoji groups
# These are stored in a single associative array, $emoji_groups, to avoid cluttering up the global
# namespace, and to allow adding additional group definitions at run time.
# The keys are the group names, and the values are whitespace-separated lists of emoji character names.
#
# These extra local arrays are used to allow more convenient formatting of the source code.
emoji_groups[fruits]="
tomato
aubergine
grapes
melon
watermelon
tangerine
banana
pineapple
red_apple
green_apple
peach
cherries
strawberry
lemon
pear
"
emoji_groups[vehicles]="
airplane
rocket
railway_car
high_speed_train
high_speed_train_with_bullet_nose
bus
ambulance
fire_engine
police_car
taxi
automobile
recreational_vehicle
delivery_truck
ship
speedboat
bicycle
helicopter
steam_locomotive
train
light_rail
tram
oncoming_bus
trolleybus
minibus
oncoming_police_car
oncoming_taxi
oncoming_automobile
articulated_lorry
tractor
monorail
mountain_railway
suspension_railway
mountain_cableway
aerial_tramway
rowboat
bicyclist
mountain_bicyclist
sailboat
"
emoji_groups[animals]="
snail
snake
horse
sheep
monkey
chicken
boar
elephant
octopus
spiral_shell
bug
ant
honeybee
lady_beetle
fish
tropical_fish
blowfish
turtle
hatching_chick
baby_chick
front_facing_baby_chick
bird
penguin
koala
poodle
bactrian_camel
dolphin
mouse_face
cow_face
tiger_face
rabbit_face
cat_face
dragon_face
spouting_whale
horse_face
monkey_face
dog_face
pig_face
frog_face
hamster_face
wolf_face
bear_face
panda_face
rat
mouse
ox
water_buffalo
cow
tiger
leopard
rabbit
cat
dragon
crocodile
whale
ram
goat
rooster
dog
pig
dromedary_camel
"
emoji_groups[faces]="
grinning_face_with_smiling_eyes
face_with_tears_of_joy
smiling_face_with_open_mouth
smiling_face_with_open_mouth_and_smiling_eyes
smiling_face_with_open_mouth_and_cold_sweat
smiling_face_with_open_mouth_and_tightly_closed_eyes
winking_face
smiling_face_with_smiling_eyes
face_savouring_delicious_food
relieved_face
smiling_face_with_heart_shaped_eyes
smirking_face
unamused_face
face_with_cold_sweat
pensive_face
confounded_face
face_throwing_a_kiss
kissing_face_with_closed_eyes
face_with_stuck_out_tongue_and_winking_eye
face_with_stuck_out_tongue_and_tightly_closed_eyes
disappointed_face
angry_face
pouting_face
crying_face
persevering_face
face_with_look_of_triumph
disappointed_but_relieved_face
fearful_face
weary_face
sleepy_face
tired_face
loudly_crying_face
face_with_open_mouth_and_cold_sweat
face_screaming_in_fear
astonished_face
flushed_face
dizzy_face
face_with_medical_mask
"
}
# Prints a random emoji character
#
# random_emoji [group]
#
function random_emoji() {
local group=$1
local names
if [[ -z "$group" || "$group" == "all" ]]; then
names=(${(k)emoji})
else
names=(${=emoji_groups[$group_name]})
fi
local list_size=$#names
local random_index=$(( ( RANDOM % $list_size ) + 1 ))
local name=${names[$random_index]}
echo ${emoji[$name]}
}
# Displays a listing of emoji with their names
#
# display_emoji [group]
#
function display_emoji() {
local group=$1
local names
if [[ -z "$group" || "$group" == "all" ]]; then
names=(${(k)emoji})
else
names=(${=emoji_groups[$group]})
fi
# The extra spaces in output here are a hack for readability, since some
# terminals treat these emoji chars as single-width.
for i in $names; do
printf '%s ' "$emoji[$i]"
done
print
for i in $names; do
echo "${emoji[$i]} = $i"
done
}

View file

@ -0,0 +1,113 @@
#!/usr/bin/perl -w
#
# update_emoji.pl
#
# This script generates the emoji.plugin.zsh emoji definitions from the Unicode
# character data for the emoji characters.
#
# The data file can be found at http://unicode.org/Public/emoji/latest/emoji-data.txt
# as referenced in Unicode TR51 (http://www.unicode.org/reports/tr51/index.html).
#
# This is known to work with the data file from version 1.0. It may not work with later
# versions if the format changes. In particular, this reads line comments to get the
# emoji character name and unicode version.
#
# Country names have punctuation and other non-letter characters removed from their name,
# to avoid possible complications with having to escape the strings when using them as
# array subscripts. The definition file seems to use some combining characters like accents
# that get stripped during this process.
use strict;
use warnings;
use 5.010;
use autodie;
use Path::Class;
use File::Copy;
# Parse definitions out of the data file and convert
sub process_emoji_data_file {
my ( $infile, $outfilename ) = @_;
my $file = file($infile);
my $outfile = file($outfilename);
my $outfilebase = $outfile->basename();
my $tempfilename = "$outfilename.tmp";
my $tempfile = file($tempfilename);
my $outfh = $tempfile->openw();
$outfh->print("
# $outfilebase - Emoji character definitions for oh-my-zsh emoji plugin
#
# This file is auto-generated by update_emoji.pl. Do not edit it manually.
#
# This contains the definition for:
# \$emoji - which maps character names to Unicode characters
# \$emoji_flags - maps country names to Unicode flag characters using region indicators
# Main emoji
typeset -gAH emoji
# National flags
typeset -gAH emoji_flags
# Combining modifiers
typeset -gAH emoji_mod
");
my $fh = $file->openr();
my $line_num = 0;
while ( my $line = $fh->getline() ) {
$line_num++;
$_ = $line;
# Skip all-comment lines (from the header) and blank lines
# (But don't strip comments on normal lines; we need to parse those for
# the emoji names.)
next if /^\s*#/ or /^\s*$/;
if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) {
my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name)
= ($1, $2, $3, $4, $5, $6, $7);
#print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n";
my @code_points = split /\s+/, $code;
my @sources = split /\s+/, $sources;
my $flag_country = "";
if ( $keycap_name =~ /^flag for (\S.*?)\s*$/) {
$flag_country = $1;
}
my $zsh_code = join '', map { "\\U$_" } @code_points;
# Convert keycap names to valid associative array names that do not require any
# quoting. Works fine for most stuff, but is clumsy for flags.
my $omz_name = lc($keycap_name);
$omz_name =~ s/[^A-Za-z0-9]/_/g;
my $zsh_flag_country = $flag_country;
$zsh_flag_country =~ s/[^\p{Letter}]/_/g;
if ($flag_country) {
$outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n");
} else {
$outfh->print("emoji[$omz_name]=\$'$zsh_code'\n");
}
# Modifiers are included in both the main set and their separate map,
# because they have a standalone representation as a color swatch.
if ( $modifier_status == "modifier" ) {
$outfh->print("emoji_mod[$omz_name]=\$'$zsh_code'\n");
}
} else {
die "Failed parsing line $line_num: '$_'";
}
}
$fh->close();
$outfh->print("\n");
$outfh->close();
move($tempfilename, $outfilename)
or die "Failed moving temp file to $outfilename: $!";
}
my $datafile = "emoji-data.txt";
my $zsh_def_file = "emoji-char-definitions.zsh";
process_emoji_data_file($datafile, $zsh_def_file);
print "Updated definition file $zsh_def_file\n";

View file

@ -3,6 +3,6 @@
_arguments \ _arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|ipsw|rar|7z|deb)(-.)'" && return 0

View file

@ -23,7 +23,7 @@ function extract() {
remove_archive=1 remove_archive=1
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
remove_archive=0 remove_archive=0
shift shift
fi fi
@ -52,7 +52,7 @@ function extract() {
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;; (*.Z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package) unzip "$1" -d $extract_dir ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;; (*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;
(*.deb) (*.deb)
@ -64,10 +64,10 @@ function extract() {
cd ..; rm *.tar.gz debian-binary cd ..; rm *.tar.gz debian-binary
cd .. cd ..
;; ;;
(*) (*)
echo "extract: '$1' cannot be extracted" 1>&2 echo "extract: '$1' cannot be extracted" 1>&2
success=1 success=1
;; ;;
esac esac
(( success = $success > 0 ? $success : $? )) (( success = $success > 0 ? $success : $? ))

View file

@ -1,11 +1,11 @@
if [ $commands[fasd] ]; then # check if fasd is installed if [ $commands[fasd] ]; then # check if fasd is installed
fasd_cache="$HOME/.fasd-init-cache" fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache"
if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
fasd --init auto >| "$fasd_cache" fasd --init auto >| "$fasd_cache"
fi fi
source "$fasd_cache" source "$fasd_cache"
unset fasd_cache unset fasd_cache
alias v='f -e vim'
alias o='a -e open'
fi
alias v='f -e vim'
alias o='a -e open_command'
fi

View file

@ -1,6 +1,7 @@
# start fbterm automatically in /dev/tty* # start fbterm automatically in /dev/tty*
if [[ $(tty|grep -o '/dev/tty') = /dev/tty ]] ; then if (( ${+commands[fbterm]} )); then
fbterm if [[ "$TTY" = /dev/tty* ]] ; then
exit fbterm && exit
fi
fi fi

View file

@ -0,0 +1,13 @@
## forklift
Plugin for ForkLift, an FTP application for OS X.
### Requirements
* [ForkLift](http://forkliftapp.com/forklift/)
### Usage
* If `fl` is called without arguments then the current folder is opened in ForkLift. Is equivalent to `fl .`
* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift

View file

@ -1,18 +1,12 @@
## Rationale ## ## Rationale ##
The idea for this script is to help searches in important doc contents from frontend. > Searches for your Frontend contents more easier
## Instalation ## ## 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 Open your `.zshrc` file and load `frontend-search` plugin
```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 ```bash
... ...
@ -20,6 +14,7 @@ plugins=( <your-plugins-list>... frontend-search)
... ...
``` ```
## Commands ## ## Commands ##
All command searches are accept only in format All command searches are accept only in format
@ -47,6 +42,7 @@ The search content are
* `angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>` * `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>` * `reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
* `emberjs <emberjs.com>` * `emberjs <emberjs.com>`
* `stackoverflow <stackoverflow.com>`
## Aliases ## ## Aliases ##
@ -72,10 +68,13 @@ There are a few aliases presented as well:
* `angularjs` A shorthand for `frontend angularjs` * `angularjs` A shorthand for `frontend angularjs`
* `reactjs` A shorthand for `frontend reactjs` * `reactjs` A shorthand for `frontend reactjs`
* `emberjs` A shorthand for `frontend emberjs` * `emberjs` A shorthand for `frontend emberjs`
* `stackoverflow` A shorthand for `frontend stackoverflow`
## Author ## Author
**Wilson Mendes (willmendesneto)** **Wilson Mendes (willmendesneto)**
+ <https://plus.google.com/+WilsonMendes>
+ <https://twitter.com/willmendesneto> + <https://twitter.com/willmendesneto>
+ <http://github.com/willmendesneto> + <http://github.com/willmendesneto>

View file

@ -0,0 +1,128 @@
#compdef frontend
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion::complete:frontend:*:commands' group-name commands
zstyle ':completion::complete:frontend:*:frontend_points' group-name frontend_points
zstyle ':completion::complete:frontend::' list-grouped
zmodload zsh/mapfile
function _frontend() {
local CONFIG=$HOME/.frontend-search
local ret=1
local -a commands
local -a frontend_points
frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
commands=(
'jquery: Search in jQuery website'
'mdn: Search in MDN website'
'compass: Search in COMPASS website'
'html5please: Search in HTML5 Please website'
'caniuse: Search in Can I Use website'
'aurajs: Search in AuraJs website'
'dartlang: Search in Dart website'
'lodash: Search in Lo-Dash website'
'qunit: Search in Qunit website'
'fontello: Search in fontello website'
'bootsnipp: Search in bootsnipp website'
'cssflow: Search in cssflow website'
'codepen: Search in codepen website'
'unheap: Search in unheap website'
'bem: Search in BEM website'
'smacss: Search in SMACSS website'
'angularjs: Search in Angular website'
'reactjs: Search in React website'
'emberjs: Search in Ember website'
'stackoverflow: Search in StackOverflow website'
)
_arguments -C \
'1: :->first_arg' \
'2: :->second_arg' && ret=0
case $state in
first_arg)
_describe -t frontend_points "Warp points" frontend_points && ret=0
_describe -t commands "Commands" commands && ret=0
;;
second_arg)
case $words[2] in
jquery)
_describe -t points "Warp points" frontend_points && ret=0
;;
mdn)
_describe -t points "Warp points" frontend_points && ret=0
;;
compass)
_describe -t points "Warp points" frontend_points && ret=0
;;
html5please)
_describe -t points "Warp points" frontend_points && ret=0
;;
caniuse)
_describe -t points "Warp points" frontend_points && ret=0
;;
aurajs)
_describe -t points "Warp points" frontend_points && ret=0
;;
dartlang)
_describe -t points "Warp points" frontend_points && ret=0
;;
lodash)
_describe -t points "Warp points" frontend_points && ret=0
;;
qunit)
_describe -t points "Warp points" frontend_points && ret=0
;;
fontello)
_describe -t points "Warp points" frontend_points && ret=0
;;
bootsnipp)
_describe -t points "Warp points" frontend_points && ret=0
;;
cssflow)
_describe -t points "Warp points" frontend_points && ret=0
;;
codepen)
_describe -t points "Warp points" frontend_points && ret=0
;;
unheap)
_describe -t points "Warp points" frontend_points && ret=0
;;
bem)
_describe -t points "Warp points" frontend_points && ret=0
;;
smacss)
_describe -t points "Warp points" frontend_points && ret=0
;;
angularjs)
_describe -t points "Warp points" frontend_points && ret=0
;;
reactjs)
_describe -t points "Warp points" frontend_points && ret=0
;;
emberjs)
_describe -t points "Warp points" frontend_points && ret=0
;;
stackoverflow)
_describe -t points "Warp points" frontend_points && ret=0
;;
esac
;;
esac
return $ret
}
_frontend "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -2,14 +2,6 @@
function frontend() { 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 # no keyword provided, simply show how call methods
if [[ $# -le 1 ]]; then if [[ $# -le 1 ]]; then
echo "Please provide a search-content and a search-term for app.\nEx:\nfrontend <search-content> <search-term>\n" echo "Please provide a search-content and a search-term for app.\nEx:\nfrontend <search-content> <search-term>\n"
@ -17,7 +9,7 @@ function frontend() {
fi fi
# check whether the search engine is supported # 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)' ]]; if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow)' ]];
then then
echo "Search valid search content $1 not supported." echo "Search valid search content $1 not supported."
echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')" echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
@ -40,6 +32,7 @@ function frontend() {
echo "* angularjs" echo "* angularjs"
echo "* reactjs" echo "* reactjs"
echo "* emberjs" echo "* emberjs"
echo "* stackoverflow"
echo "" echo ""
return 1 return 1
@ -103,13 +96,16 @@ function frontend() {
"emberjs") "emberjs")
url="${url}emberjs.com" url="${url}emberjs.com"
url="${url}/api/#stq=$2&stp=1" ;; url="${url}/api/#stq=$2&stp=1" ;;
"stackoverflow")
url="${url}stackoverflow.com"
url="${url}/search?q=$2" ;;
*) echo "INVALID PARAM!" *) echo "INVALID PARAM!"
return ;; return ;;
esac esac
echo "$url" echo "$url"
$open_cmd "$url" open_command "$url"
} }
@ -149,3 +145,6 @@ alias smacss='frontend smacss'
alias angularjs='frontend angularjs' alias angularjs='frontend angularjs'
alias reactjs='frontend reactjs' alias reactjs='frontend reactjs'
alias emberjs='frontend emberjs' alias emberjs='frontend emberjs'
# search websites
alias stackoverflow='frontend stackoverflow'

View file

@ -5,7 +5,7 @@
# #
# To achieve git-flow completion nirvana: # 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 # 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: # 1. Install this file. Either:
@ -17,7 +17,7 @@
# #
# source ~/.git-flow-completion.zsh # 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 #Alias

View file

@ -5,7 +5,7 @@
# #
# To achieve git-hubflow completion nirvana: # 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 # 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: # 1. Install this file. Either:
@ -17,7 +17,7 @@
# #
# source ~/.git-hubflow-completion.zsh # 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 () _git-hf ()

View file

@ -1,4 +1,10 @@
## git ## git
**Maintainer:** [Stibbons](https://github.com/Stibbons)
This plugin adds several git aliases and increase the completion function provided by zsh **Maintainer:** [@ncanceill](https://github.com/ncanceill)
This plugin adds many useful aliases and functions.
### Usage
See the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git) for a list of aliases and functions provided by the plugin.

View file

@ -1,83 +0,0 @@
#compdef git-branch
_git-branch ()
{
declare l c m d
l='--color --no-color -r -a --all -v --verbose --abbrev --no-abbrev'
c='-l -f --force -t --track --no-track --set-upstream --contains --merged --no-merged'
m='-m -M'
d='-d -D'
declare -a dependent_creation_args
if (( words[(I)-r] == 0 )); then
dependent_creation_args=(
"($l $m $d): :__git_branch_names"
"::start-point:__git_revisions")
fi
declare -a dependent_deletion_args
if (( words[(I)-d] || words[(I)-D] )); then
dependent_creation_args=
dependent_deletion_args=(
'-r[delete only remote-tracking branches]')
if (( words[(I)-r] )); then
dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names'
else
dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names'
fi
fi
declare -a dependent_modification_args
if (( words[(I)-m] || words[(I)-M] )); then
dependent_creation_args=
dependent_modification_args=(
':old or new branch name:__git_branch_names'
'::new branch name:__git_branch_names')
fi
_arguments -w -S -s \
"($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \
"($c $m $d : --color)--no-color[turn off branch coloring]" \
"($c $m -a --all)-r[list or delete only remote-tracking branches]" \
"($c $m $d : -r)"{-a,--all}"[list both remote-tracking branches and local branches]" \
"($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \
"($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \
"($c $m $d :)--no-abbrev[do not abbreviate sha1s]" \
"($l $m $d)-l[create the branch's reflog]" \
"($l $m $d -f --force)"{-f,--force}"[force the creation of a new branch]" \
"($l $m $d -t --track)"{-t,--track}"[set up configuration so that pull merges from the start point]" \
"($l $m $d)--no-track[override the branch.autosetupmerge configuration variable]" \
"($l $m $d)--set-upstream[set up configuration so that pull merges]" \
"($l $m $d)--contains=[only list branches which contain the specified commit]: :__git_committishs" \
"($l $m $d)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \
"($l $m $d)--no-merged=[do not list branches which are fully contained by HEAD]: :__git_committishs" \
$dependent_creation_args \
"($l $c $d -M)-m[rename a branch and the corresponding reflog]" \
"($l $c $d -m)-M[rename a branch even if the new branch-name already exists]" \
$dependent_modification_args \
"($l $c $m -D)-d[delete a fully merged branch]" \
"($l $c $m -d)-D[delete a branch]" \
$dependent_deletion_args
}
(( $+functions[__git_ignore_line] )) ||
__git_ignore_line () {
declare -a ignored
ignored=()
((CURRENT > 1)) &&
ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
((CURRENT < $#line)) &&
ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
$* -F ignored
}
(( $+functions[__git_ignore_line_inside_arguments] )) ||
__git_ignore_line_inside_arguments () {
declare -a compadd_opts
zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F:
__git_ignore_line $* $compadd_opts
}

View file

@ -1,74 +0,0 @@
#compdef git-remote
# NOTE: --track is undocumented.
# TODO: --track, -t, --master, and -m should take remote branches, I guess.
# NOTE: --master is undocumented.
# NOTE: --fetch is undocumented.
_git-remote () {
local curcontext=$curcontext state line
declare -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options' && ret=0
case $state in
(command)
declare -a commands
commands=(
'add:add a new remote'
'show:show information about a given remote'
'prune:delete all stale tracking branches for a given remote'
'update:fetch updates for a set of remotes'
'rm:remove a remote from .git/config and all associated tracking branches'
'rename:rename a remote from .git/config and update all associated tracking branches'
'set-head:sets or deletes the default branch'
'set-branches:changes the list of branches tracked by the named remote.'
'set-url:changes URL remote points to.'
)
_describe -t commands 'sub-command' commands && ret=0
;;
(options)
case $line[1] in
(add)
_arguments \
'*'{--track,-t}'[track given branch instead of default glob refspec]:branch:__git_branch_names' \
'(--master -m)'{--master,-m}'[set the remote'\''s HEAD to point to given master branch]:branch:__git_branch_names' \
'(--fetch -f)'{--fetch,-f}'[run git-fetch on the new remote after it has been created]' \
':branch name:__git_remotes' \
':url:_urls' && ret=0
;;
(show)
_arguments \
'-n[do not contact the remote for a list of branches]' \
':remote:__git_remotes' && ret=0
;;
(prune)
_arguments \
'(--dry-run -n)'{-n,--dry-run}'[do not actually prune, only list what would be done]' \
':remote:__git_remotes' && ret=0
;;
(update)
__git_remote-groups && ret=0
;;
(rm)
__git_remotes && ret=0
;;
(rename)
__git_remotes && ret=0
;;
(set-url)
_arguments \
'*--push[manipulate push URLs]' \
'(--add)--add[add URL]' \
'(--delete)--delete[delete URLs]' \
':branch name:__git_remotes' \
':url:_urls' && ret=0
;;
esac
;;
esac
}

View file

@ -1,179 +1,221 @@
# Aliases # Query/use custom command for `git`.
alias g='git' zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd
compdef g=git : ${_omz_git_git_cmd:=git}
alias gst='git status'
compdef _git gst=git-status
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'
compdef _git gup=git-fetch
alias gp='git push'
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'
compdef _git gc!=git-commit
alias gca='git commit -v -a'
compdef _git gc=git-commit
alias gca!='git commit -v -a --amend'
compdef _git gca!=git-commit
alias gcmsg='git commit -m'
compdef _git gcmsg=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
alias gcm='git checkout master'
alias gr='git remote'
compdef _git gr=git-remote
alias grv='git remote -v'
compdef _git grv=git-remote
alias grmv='git remote rename'
compdef _git grmv=git-remote
alias grrm='git remote remove'
compdef _git grrm=git-remote
alias grset='git remote set-url'
compdef _git grset=git-remote
alias grup='git remote update'
compdef _git grset=git-remote
alias grbi='git rebase -i'
compdef _git grbi=git-rebase
alias grbc='git rebase --continue'
compdef _git grbc=git-rebase
alias grba='git rebase --abort'
compdef _git grba=git-rebase
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'
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
alias glg='git log --stat --max-count=10'
compdef _git glg=git-log
alias glgg='git log --graph --max-count=10'
compdef _git glgg=git-log
alias glgga='git log --graph --decorate --all'
compdef _git glgga=git-log
alias glo='git log --oneline --decorate --color'
compdef _git glo=git-log
alias glog='git log --oneline --decorate --color --graph'
compdef _git glog=git-log
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 gm='git merge'
compdef _git gm=git-merge
alias grh='git reset HEAD'
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'
alias gpoat='git push origin --all && git push origin --tags'
alias gmt='git mergetool --no-prompt'
compdef _git gm=git-mergetool
alias gg='git gui citool'
alias gga='git gui citool --amend'
alias gk='gitk --all --branches'
alias gsts='git stash show --text'
alias gsta='git stash'
alias gstp='git stash pop'
alias gstd='git stash drop'
# Will cd into the top of the current repository
# or submodule.
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
# Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
compdef git-svn-dcommit-push=git
alias gsr='git svn rebase'
alias gsd='git svn dcommit'
# #
# Will return the current branch name # Functions
#
# The current branch name
# Usage example: git pull origin $(current_branch) # Usage example: git pull origin $(current_branch)
# # Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
# it's not a symbolic ref, but in a Git repo.
function current_branch() { function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \ local ref
ref=$(git rev-parse --short HEAD 2> /dev/null) || return ref=$($_omz_git_git_cmd symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$($_omz_git_git_cmd rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/} echo ${ref#refs/heads/}
} }
# The list of remotes
function current_repository() { function current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \ if ! $_omz_git_git_cmd rev-parse --is-inside-work-tree &> /dev/null; then
ref=$(git rev-parse --short HEAD 2> /dev/null) || return return
echo $(git remote -v | cut -d':' -f 2) fi
echo $($_omz_git_git_cmd remote -v | cut -d':' -f 2)
} }
# these aliases take advantage of the previous function
alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git
alias ggpur='git pull --rebase origin $(current_branch)'
compdef ggpur=git
alias ggpush='git push origin $(current_branch)'
compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
compdef ggpnp=git
# Pretty log messages # Pretty log messages
function _git_log_prettily(){ function _git_log_prettily(){
if ! [ -z $1 ]; then if ! [ -z $1 ]; then
git log --pretty=$1 git log --pretty=$1
fi fi
} }
alias glp="_git_log_prettily" # Warn if the current branch is a WIP
compdef _git glp=git-log
# Work In Progress (wip)
# These features allow to pause a branch development and switch to another one (wip)
# When you want to go back to work, just unwip it
#
# This function return a warning if the current branch is a wip
function work_in_progress() { function work_in_progress() {
if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
echo "WIP!!" echo "WIP!!"
fi fi
} }
# these alias commit and uncomit wip branches
alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
# these alias ignore changes to file #
# Aliases
# (sorted alphabetically)
#
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gb='git branch'
alias gba='git branch -a'
alias gbda='git branch --merged | command grep -vE "^(\*|\s*master\s*$)" | command xargs -n 1 git branch -d'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a -s --no-edit --amend'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
alias gclean='git reset --hard && git clean -dfx'
alias gcm='git checkout master'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcount='git shortlog -sn'
compdef gcount=git
alias gcp='git cherry-pick'
alias gcs='git commit -S'
alias gd='git diff'
alias gdca='git diff --cached'
alias gdt='git diff-tree --no-commit-id --name-only -r'
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gdw='git diff --word-diff'
alias gf='git fetch'
alias gfa='git fetch --all --prune'
function gfg() { git ls-files | grep $@ }
compdef gfg=grep
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
ggf() {
[[ "$#" != 1 ]] && local b="$(current_branch)"
git push --force origin "${b:=$1}"
}
compdef _git ggf=git-checkout
ggl() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git pull origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(current_branch)"
git pull origin "${b:=$1}"
fi
}
compdef _git ggl=git-checkout
alias ggpull='git pull origin $(current_branch)'
compdef _git ggpull=git-checkout
ggp() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git push origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(current_branch)"
git push origin "${b:=$1}"
fi
}
compdef _git ggp=git-checkout
alias ggpush='git push origin $(current_branch)'
compdef _git ggpush=git-checkout
ggpnp() {
if [[ "$#" == 0 ]]; then
ggl && ggp
else
ggl "${*}" && ggp "${*}"
fi
}
compdef _git ggpnp=git-checkout
alias ggsup='git branch --set-upstream-to=origin/$(current_branch)'
ggu() {
[[ "$#" != 1 ]] && local b="$(current_branch)"
git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
alias ggpur='ggu'
compdef _git ggpur=git-checkout
alias gignore='git update-index --assume-unchanged' 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:]]"' alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
compdef git-svn-dcommit-push=git
alias gk='\gitk --all --branches'
compdef _git gk='gitk'
alias gke='\gitk --all $(git log -g --pretty=format:%h)'
compdef _git gke='gitk'
alias gl='git pull'
alias glg='git log --stat --color'
alias glgp='git log --stat --color -p'
alias glgg='git log --graph --color'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate --color'
alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
alias glog='git log --oneline --decorate --color --graph'
alias glp="_git_log_prettily"
compdef _git glp=git-log
alias gm='git merge'
alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpoat='git push origin --all && git push origin --tags'
compdef _git gpoat=git-push
alias gpu='git push upstream'
alias gpv='git push -v'
alias gr='git remote'
alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
alias gsta='git stash'
alias gstaa='git stash apply'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gsu='git submodule update'
alias gts='git tag -s'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias gvt='git verify-tag'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"'

View file

@ -30,10 +30,10 @@ if [ -z "$script" ]; then
local -a locations local -a locations
local e local e
locations=( locations=(
"$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash"
'/etc/bash_completion.d/git' # fedora, old debian '/etc/bash_completion.d/git' # fedora, old debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
'/usr/share/bash-completion/git' # gentoo '/usr/share/bash-completion/git' # gentoo
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
) )
for e in $locations; do for e in $locations; do
test -f $e && script="$e" && break test -f $e && script="$e" && break
@ -76,6 +76,14 @@ __gitcomp_nl ()
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
} }
__gitcomp_nl_append ()
{
emulate -L zsh
local IFS=$'\n'
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
}
__gitcomp_file () __gitcomp_file ()
{ {
emulate -L zsh emulate -L zsh

View file

@ -1,5 +1,3 @@
#!bash
#
# bash/zsh completion support for core Git. # bash/zsh completion support for core Git.
# #
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
@ -180,9 +178,9 @@ _get_comp_words_by_ref ()
} }
fi fi
__gitcompadd () __gitcompappend ()
{ {
local i=0 local i=${#COMPREPLY[@]}
for x in $1; do for x in $1; do
if [[ "$x" == "$3"* ]]; then if [[ "$x" == "$3"* ]]; then
COMPREPLY[i++]="$2$x$4" COMPREPLY[i++]="$2$x$4"
@ -190,6 +188,12 @@ __gitcompadd ()
done done
} }
__gitcompadd ()
{
COMPREPLY=()
__gitcompappend "$@"
}
# Generates completion reply, appending a space to possible completion words, # Generates completion reply, appending a space to possible completion words,
# if necessary. # if necessary.
# It accepts 1 to 4 arguments: # It accepts 1 to 4 arguments:
@ -220,6 +224,14 @@ __gitcomp ()
esac esac
} }
# Variation of __gitcomp_nl () that appends to the existing list of
# completion candidates, COMPREPLY.
__gitcomp_nl_append ()
{
local IFS=$'\n'
__gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }"
}
# Generates completion reply from newline-separated possible completion words # Generates completion reply from newline-separated possible completion words
# by appending a space to all of them. # by appending a space to all of them.
# It accepts 1 to 4 arguments: # It accepts 1 to 4 arguments:
@ -231,8 +243,8 @@ __gitcomp ()
# appended. # appended.
__gitcomp_nl () __gitcomp_nl ()
{ {
local IFS=$'\n' COMPREPLY=()
__gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }" __gitcomp_nl_append "$@"
} }
# Generates completion reply with compgen from newline-separated possible # Generates completion reply with compgen from newline-separated possible
@ -673,7 +685,6 @@ __git_list_porcelain_commands ()
index-pack) : plumbing;; index-pack) : plumbing;;
init-db) : deprecated;; init-db) : deprecated;;
local-fetch) : plumbing;; local-fetch) : plumbing;;
lost-found) : infrequent;;
ls-files) : plumbing;; ls-files) : plumbing;;
ls-remote) : plumbing;; ls-remote) : plumbing;;
ls-tree) : plumbing;; ls-tree) : plumbing;;
@ -687,14 +698,12 @@ __git_list_porcelain_commands ()
pack-refs) : plumbing;; pack-refs) : plumbing;;
parse-remote) : plumbing;; parse-remote) : plumbing;;
patch-id) : plumbing;; patch-id) : plumbing;;
peek-remote) : plumbing;;
prune) : plumbing;; prune) : plumbing;;
prune-packed) : plumbing;; prune-packed) : plumbing;;
quiltimport) : import;; quiltimport) : import;;
read-tree) : plumbing;; read-tree) : plumbing;;
receive-pack) : plumbing;; receive-pack) : plumbing;;
remote-*) : transport;; remote-*) : transport;;
repo-config) : deprecated;;
rerere) : plumbing;; rerere) : plumbing;;
rev-list) : plumbing;; rev-list) : plumbing;;
rev-parse) : plumbing;; rev-parse) : plumbing;;
@ -707,7 +716,6 @@ __git_list_porcelain_commands ()
ssh-*) : transport;; ssh-*) : transport;;
stripspace) : plumbing;; stripspace) : plumbing;;
symbolic-ref) : plumbing;; symbolic-ref) : plumbing;;
tar-tree) : deprecated;;
unpack-file) : plumbing;; unpack-file) : plumbing;;
unpack-objects) : plumbing;; unpack-objects) : plumbing;;
update-index) : plumbing;; update-index) : plumbing;;
@ -901,7 +909,7 @@ _git_add ()
esac esac
# XXX should we check for --update and --all options ? # XXX should we check for --update and --all options ?
__git_complete_index_file "--others --modified" __git_complete_index_file "--others --modified --directory --no-empty-directory"
} }
_git_archive () _git_archive ()
@ -1063,7 +1071,7 @@ _git_clean ()
esac esac
# XXX should we check for -x option ? # XXX should we check for -x option ?
__git_complete_index_file "--others" __git_complete_index_file "--others --directory"
} }
_git_clone () _git_clone ()
@ -1188,7 +1196,7 @@ _git_diff ()
__git_complete_revlist_file __git_complete_revlist_file
} }
__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff __git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
" "
@ -1491,6 +1499,12 @@ _git_mergetool ()
_git_merge_base () _git_merge_base ()
{ {
case "$cur" in
--*)
__gitcomp "--octopus --independent --is-ancestor --fork-point"
return
;;
esac
__gitcomp_nl "$(__git_refs)" __gitcomp_nl "$(__git_refs)"
} }
@ -1623,7 +1637,7 @@ _git_rebase ()
--preserve-merges --stat --no-stat --preserve-merges --stat --no-stat
--committer-date-is-author-date --ignore-date --committer-date-is-author-date --ignore-date
--ignore-whitespace --whitespace= --ignore-whitespace --whitespace=
--autosquash --autosquash --fork-point --no-fork-point
" "
return return
@ -1833,6 +1847,7 @@ _git_config ()
branch.*) branch.*)
local pfx="${cur%.*}." cur_="${cur#*.}" local pfx="${cur%.*}." cur_="${cur#*.}"
__gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "."
__gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_"
return return
;; ;;
guitool.*.*) guitool.*.*)
@ -1875,6 +1890,7 @@ _git_config ()
remote.*) remote.*)
local pfx="${cur%.*}." cur_="${cur#*.}" local pfx="${cur%.*}." cur_="${cur#*.}"
__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
__gitcomp_nl_append "pushdefault" "$pfx" "$cur_"
return return
;; ;;
url.*.*) url.*.*)
@ -1997,6 +2013,7 @@ _git_config ()
fetch.unpackLimit fetch.unpackLimit
format.attach format.attach
format.cc format.cc
format.coverLetter
format.headers format.headers
format.numbered format.numbered
format.pretty format.pretty
@ -2580,7 +2597,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then
--*=*|*.) ;; --*=*|*.) ;;
*) c="$c " ;; *) c="$c " ;;
esac esac
array[$#array+1]="$c" array[${#array[@]}+1]="$c"
done done
compset -P '*[=:]' compset -P '*[=:]'
compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 compadd -Q -S '' -p "${2-}" -a -- array && _ret=0

View file

@ -60,6 +60,7 @@
# of values: # of values:
# #
# verbose show number of commits ahead/behind (+/-) upstream # verbose show number of commits ahead/behind (+/-) upstream
# name if verbose, then also show the upstream abbrev name
# legacy don't use the '--count' option available in recent # legacy don't use the '--count' option available in recent
# versions of git-rev-list # versions of git-rev-list
# git always compare HEAD to @{upstream} # git always compare HEAD to @{upstream}
@ -84,13 +85,17 @@
# the colored output of "git status -sb" and are available only when # the colored output of "git status -sb" and are available only when
# using __git_ps1 for PROMPT_COMMAND or precmd. # using __git_ps1 for PROMPT_COMMAND or precmd.
# check whether printf supports -v
__git_printf_supports_v=
printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1
# stores the divergence from upstream in $p # stores the divergence from upstream in $p
# used by GIT_PS1_SHOWUPSTREAM # used by GIT_PS1_SHOWUPSTREAM
__git_ps1_show_upstream () __git_ps1_show_upstream ()
{ {
local key value local key value
local svn_remote svn_url_pattern count n local svn_remote svn_url_pattern count n
local upstream=git legacy="" verbose="" local upstream=git legacy="" verbose="" name=""
svn_remote=() svn_remote=()
# get some config options from git-config # get some config options from git-config
@ -106,7 +111,7 @@ __git_ps1_show_upstream ()
;; ;;
svn-remote.*.url) svn-remote.*.url)
svn_remote[$((${#svn_remote[@]} + 1))]="$value" svn_remote[$((${#svn_remote[@]} + 1))]="$value"
svn_url_pattern+="\\|$value" svn_url_pattern="$svn_url_pattern\\|$value"
upstream=svn+git # default upstream is SVN if available, else git upstream=svn+git # default upstream is SVN if available, else git
;; ;;
esac esac
@ -118,6 +123,7 @@ __git_ps1_show_upstream ()
git|svn) upstream="$option" ;; git|svn) upstream="$option" ;;
verbose) verbose=1 ;; verbose) verbose=1 ;;
legacy) legacy=1 ;; legacy) legacy=1 ;;
name) name=1 ;;
esac esac
done done
@ -200,6 +206,9 @@ __git_ps1_show_upstream ()
*) # diverged from upstream *) # diverged from upstream
p=" u+${count#* }-${count% *}" ;; p=" u+${count#* }-${count% *}" ;;
esac esac
if [[ -n "$count" && -n "$name" ]]; then
p="$p $(git rev-parse --abbrev-ref "$upstream" 2>/dev/null)"
fi
fi fi
} }
@ -250,6 +259,13 @@ __git_ps1_colorize_gitstring ()
r="$c_clear$r" r="$c_clear$r"
} }
eread ()
{
f="$1"
shift
test -r "$f" && read "$@" <"$f"
}
# __git_ps1 accepts 0 or 1 arguments (i.e., format string) # __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# when called from PS1 using command substitution # when called from PS1 using command substitution
# in this mode it prints text to add to bash PS1 prompt (includes branch name) # in this mode it prints text to add to bash PS1 prompt (includes branch name)
@ -312,9 +328,9 @@ __git_ps1 ()
local step="" local step=""
local total="" local total=""
if [ -d "$g/rebase-merge" ]; then if [ -d "$g/rebase-merge" ]; then
read b 2>/dev/null <"$g/rebase-merge/head-name" eread "$g/rebase-merge/head-name" b
read step 2>/dev/null <"$g/rebase-merge/msgnum" eread "$g/rebase-merge/msgnum" step
read total 2>/dev/null <"$g/rebase-merge/end" eread "$g/rebase-merge/end" total
if [ -f "$g/rebase-merge/interactive" ]; then if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i" r="|REBASE-i"
else else
@ -322,10 +338,10 @@ __git_ps1 ()
fi fi
else else
if [ -d "$g/rebase-apply" ]; then if [ -d "$g/rebase-apply" ]; then
read step 2>/dev/null <"$g/rebase-apply/next" eread "$g/rebase-apply/next" step
read total 2>/dev/null <"$g/rebase-apply/last" eread "$g/rebase-apply/last" total
if [ -f "$g/rebase-apply/rebasing" ]; then if [ -f "$g/rebase-apply/rebasing" ]; then
read b 2>/dev/null <"$g/rebase-apply/head-name" eread "$g/rebase-apply/head-name" b
r="|REBASE" r="|REBASE"
elif [ -f "$g/rebase-apply/applying" ]; then elif [ -f "$g/rebase-apply/applying" ]; then
r="|AM" r="|AM"
@ -349,7 +365,7 @@ __git_ps1 ()
b="$(git symbolic-ref HEAD 2>/dev/null)" b="$(git symbolic-ref HEAD 2>/dev/null)"
else else
local head="" local head=""
if ! read head 2>/dev/null <"$g/HEAD"; then if ! eread "$g/HEAD" head; then
if [ $pcmode = yes ]; then if [ $pcmode = yes ]; then
PS1="$ps1pc_start$ps1pc_end" PS1="$ps1pc_start$ps1pc_end"
fi fi
@ -433,7 +449,7 @@ __git_ps1 ()
local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p" local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p"
if [ $pcmode = yes ]; then if [ $pcmode = yes ]; then
if [[ -n ${ZSH_VERSION-} ]]; then if [ "${__git_printf_supports_v-}" != yes ]; then
gitstring=$(printf -- "$printf_format" "$gitstring") gitstring=$(printf -- "$printf_format" "$gitstring")
else else
printf -v gitstring -- "$printf_format" "$gitstring" printf -v gitstring -- "$printf_format" "$gitstring"

View file

@ -23,6 +23,7 @@ __go_tool_complete() {
'env[print Go environment information]' 'env[print Go environment information]'
'fix[run go tool fix on packages]' 'fix[run go tool fix on packages]'
'fmt[run gofmt on package sources]' 'fmt[run gofmt on package sources]'
'generate[generate Go files by processing source]'
'get[download and install packages and dependencies]' 'get[download and install packages and dependencies]'
'help[display help]' 'help[display help]'
'install[compile and install packages and dependencies]' 'install[compile and install packages and dependencies]'

View file

@ -72,7 +72,7 @@ _gradle_tasks () {
if [ in_gradle ]; then if [ in_gradle ]; then
_gradle_arguments _gradle_arguments
if _gradle_does_task_list_need_generating; then if _gradle_does_task_list_need_generating; then
gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache gradle tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
fi fi
compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache` compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache`
fi fi
@ -82,7 +82,7 @@ _gradlew_tasks () {
if [ in_gradle ]; then if [ in_gradle ]; then
_gradle_arguments _gradle_arguments
if _gradle_does_task_list_need_generating; then if _gradle_does_task_list_need_generating; then
gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
fi fi
compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache` compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache`
fi fi

View file

@ -0,0 +1,255 @@
#compdef grunt
#autoload
# -----------------------------------------------------------------------------
# _grunt
#
# Completion script for grunt.
# - https://github.com/gruntjs/grunt
# - https://github.com/gruntjs/grunt-cli
#
# -----------------------------------------------------------------------------
#
# Version : 0.1.2
# Author : Yonchu <yuyuchu3333@gmail.com>
# License : MIT License
# Repository : https://github.com/yonchu/grunt-zsh-completion
# Last Change : 20 Aug 2014.
#
# 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.2'
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/:/\\:/g' \
| 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

View file

@ -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

View file

@ -0,0 +1,7 @@
To activate this script, please include it the `plugins` variable within `~/.zshrc`
`plugins=(git history-substring-search)`
See the "history-substring-search.zsh" file for more information:
`sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more`

View file

@ -175,7 +175,6 @@ fi
# implementation details # implementation details
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
setopt extendedglob
zmodload -F zsh/parameter zmodload -F zsh/parameter
# #
@ -284,6 +283,7 @@ if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
fi fi
function _history-substring-search-begin() { function _history-substring-search-begin() {
setopt localoptions extendedglob
_history_substring_search_move_cursor_eol=false _history_substring_search_move_cursor_eol=false
_history_substring_search_query_highlight= _history_substring_search_query_highlight=
@ -350,6 +350,7 @@ function _history-substring-search-begin() {
} }
function _history-substring-search-end() { function _history-substring-search-end() {
setopt localoptions extendedglob
_history_substring_search_result=$BUFFER _history_substring_search_result=$BUFFER
# move the cursor to the end of the command line # move the cursor to the end of the command line

15
plugins/history/README.md Normal file
View file

@ -0,0 +1,15 @@
## history
Provides a couple of convenient aliases for using the `history` command to examine your command line history.
### Requirements
* None.
### Usage
* If `h` is called, your command history is listed. Equivalent to using `history`
* If `hsi` is called with an argument, a **case insensitive** `grep` search is performed on your command history, looking for commands that match the argument provided
* If `hsi` is called without an argument you will help on `grep` arguments

6
plugins/httpie/README.md Normal file
View file

@ -0,0 +1,6 @@
## HTTPie
**Maintainer:** [lululau](https://github.com/lululau)
This plugin adds completion for HTTPie, which is a command line HTTP client, a user-friendly cURL replacement.
[HTTPie Homepage](http://httpie.org)

View file

@ -0,0 +1,33 @@
function _httpie_completion() {
_arguments -C \
'(- 1 *)--version[display version information]' \
'(-j|--json)'{-j,--json}'[(default) Data items from the command line are serialized as a JSON object]' \
'(-f|--form)'{-f,--form}'[Data items from the command line are serialized as form fields]' \
'(--pretty)--pretty[<all,colors,format,none> Controls output processing]:options' \
'(-s|--style)'{-s,--style}'[Output coloring style]' \
'(-p|--print)'{-p,--print}'[String specifying what the output should contain: H(request headers), B(request body), h(response headers), b(response body)]' \
'(-v|--verbose)'{-v,--verbose}'[Print the whole request as well as the response. Shortcut for --print=HBbh.]' \
'(-h|--headers)'{-h,--headers}'[Print only the response headers. Shortcut for --print=h]' \
'(-b|--body)'{-b,--body}'[Print only the response body. Shortcut for --print=b]' \
'(-S|--stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f'"'"']' \
'(-o|--output)'{-o,--output}'[Save output to FILE]:file:_files' \
'(-d|--download)'{-d,--download}'[Do not print the response body to stdout. Rather, download it and store it in a file. The filename is guessed unless specified with --output filename. This action is similar to the default behaviour of wget.]' \
'(-c|--continue)'{-c,--continue}'[Resume an interrupted download. Note that the --output option needs to be specified as well.]' \
'(--session)--session[Create, or reuse and update a session. Within a session, custom headers, auth credential, as well as any cookies sent by the server persist between requests]:file:_files' \
'(--session-read-only)--session-read-only[Create or read a session without updating it form the request/response exchange]:file:_files' \
'(-a|--auth)'{-a,--auth}'[<USER:PASS> If only the username is provided (-a username), HTTPie will prompt for the password]' \
'(--auth-type)--auth-type[<basic, digest> The authentication mechanism to be used. Defaults to "basic".]' \
'(--proxy)--proxy[<PROTOCOL:PROXY_URL> String mapping protocol to the URL of the proxy]' \
'(--follow)--follow[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new Location).]' \
'(--verify)--verify[<VERIFY> Set to "no" to skip checking the host'"'"'s SSL certificate. You can also pass the path to a CA_BUNDLE file for private certs. You can also set the REQUESTS_CA_BUNDLE environment variable. Defaults to "yes".]' \
'(--timeout)--timeout[<SECONDS> The connection timeout of the request in seconds. The default value is 30 seconds]' \
'(--check-status)--check-status[By default, HTTPie exits with 0 when no network or other fatal errors occur. This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
'(--ignore-stdin)--ignore-stdin[Do not attempt to read stdin]' \
'(--help)--help[Show this help message and exit]' \
'(--traceback)--traceback[Prints exception traceback should one occur]' \
'(--debug)--debug[Prints exception traceback should one occur, and also other information that is useful for debugging HTTPie itself and for reporting bugs]' \
'1: :->cmds' \
'*: :->args' && ret=0
}
compdef _httpie_completion http

View file

@ -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.

View file

@ -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'

View file

@ -11,13 +11,6 @@
# Usage: jira # opens a new issue # Usage: jira # opens a new issue
# jira ABC-123 # Opens an existing issue # jira ABC-123 # Opens an existing issue
open_jira_issue () { open_jira_issue () {
local open_cmd
if [[ "$OSTYPE" = darwin* ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
fi
if [ -f .jira-url ]; then if [ -f .jira-url ]; then
jira_url=$(cat .jira-url) jira_url=$(cat .jira-url)
elif [ -f ~/.jira-url ]; then elif [ -f ~/.jira-url ]; then
@ -39,15 +32,22 @@ open_jira_issue () {
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Opening new issue" echo "Opening new issue"
$open_cmd "${jira_url}/secure/CreateIssue!default.jspa" open_command "${jira_url}/secure/CreateIssue!default.jspa"
elif [[ "$1" = "assigned" || "$1" = "reported" ]]; then elif [[ "$1" = "assigned" || "$1" = "reported" ]]; then
jira_query $@ jira_query $@
else else
echo "Opening issue #$1" local addcomment=''
if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then if [[ "$2" == "m" ]]; then
$open_cmd "$jira_url/issues/$jira_prefix$1" addcomment="#add-comment"
echo "Add comment to issue #$1"
else else
$open_cmd "$jira_url/browse/$jira_prefix$1" echo "Opening issue #$1"
fi
if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
open_command "$jira_url/issues/$jira_prefix$1$addcomment"
else
open_command "$jira_url/browse/$jira_prefix$1$addcomment"
fi fi
fi fi
} }
@ -83,7 +83,7 @@ jira_query () {
return 1 return 1
fi fi
echo "Browsing issues ${verb} ${preposition} ${jira_name}" 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" open_command "${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' alias jira='open_jira_issue'

View file

@ -13,7 +13,7 @@ jump() {
} }
mark() { mark() {
if (( $# == 0 )); then if [[ ( $# == 0 ) || ( "$1" == "." ) ]]; then
MARK=$(basename "$PWD") MARK=$(basename "$PWD")
else else
MARK="$1" MARK="$1"

41
plugins/kitchen/_kitchen Normal file
View file

@ -0,0 +1,41 @@
# author: Peter Eisentraut
# source: https://gist.github.com/petere/10307599
# compdef kitchen
_kitchen() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments '1: :->cmds'\
'2: :->args'
case $state in
cmds)
_arguments "1:Commands:(console converge create destroy diagnose driver help init list login setup test verify version)"
;;
args)
case $line[1] in
converge|create|destroy|diagnose|list|setup|test|verify)
compadd "$@" all
_kitchen_instances
;;
login)
_kitchen_instances
;;
esac
;;
esac
}
_kitchen_instances() {
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then
unset _kitchen_instances_cache
fi
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then
_kitchen_instances_cache=(${(f)"$(bundle exec kitchen list -b 2>/dev/null || kitchen list -b 2>/dev/null)"})
_kitchen_instances_cache_dir=$PWD
fi
compadd -a _kitchen_instances_cache
}
_kitchen "$@"

View file

@ -1,6 +1,6 @@
# Laravel4 basic command completion # Laravel4 basic command completion
_laravel4_get_command_list () { _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 () { _laravel4 () {

View file

@ -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 la5cache='php artisan cache:clear'
alias la5routes='php artisan route:list'
alias la5vendor='php artisan vendor:publish'

View file

@ -8,14 +8,15 @@ mkdir -p $ZSH_CACHE_DIR
cache_file="$ZSH_CACHE_DIR/last-working-dir" cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed. # Updates the last directory once directory is changed.
function chpwd() { chpwd_functions+=(chpwd_last_working_dir)
function chpwd_last_working_dir() {
# Use >| in case noclobber is set to avoid "file exists" error # Use >| in case noclobber is set to avoid "file exists" error
pwd >| "$cache_file" pwd >| "$cache_file"
} }
# Changes directory to the last working directory. # Changes directory to the last working directory.
function lwd() { function lwd() {
[[ ! -r "$cache_file" ]] || cd `cat "$cache_file"` [[ ! -r "$cache_file" ]] || cd "`cat "$cache_file"`"
} }
# Automatically jump to last working directory unless this isn't the first time # Automatically jump to last working directory unless this isn't the first time

View file

@ -9,7 +9,7 @@ open_lighthouse_ticket () {
else else
lighthouse_url=$(cat .lighthouse-url); lighthouse_url=$(cat .lighthouse-url);
echo "Opening ticket #$1"; echo "Opening ticket #$1";
`open $lighthouse_url/tickets/$1`; open_command "$lighthouse_url/tickets/$1";
fi fi
} }

View file

@ -0,0 +1,64 @@
# Mercurial plugin
### Usage
Update .zshrc:
1. Add name to the list of plugins, e.g. `plugins = (..., mercurial, ...)`
(that is pretty obvious).
2. Change PROMPT variable of current theme to contain current folder mercurial repo info:
robbyrussel theme is used by default, so you need to modify PROMPT var
from [this file](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/robbyrussell.zsh-theme)
by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so currently it
looks next:
```diff
- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
```
and put modified var at the end of **.zshrc**.
3. Initialize additional vars used in plugin. So in short put next in **.zshrc**:
```
ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}"
ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})"
```
### What's inside?
#### Adds handy aliases:
###### general
* `hgc` - `hg commit`
* `hgb` - `hg branch`
* `hgba` - `hg branches`
* `hgbk` - `hg bookmarks`
* `hgco` - `hg checkout`
* `hgd` - `hg diff`
* `hged` - `hg diffmerge`
###### pull and update
* `hgi` - `hg incoming`
* `hgl` - `hg pull -u`
* `hglr` - `hg pull --rebase`
* `hgo` - `hg outgoing`
* `hgp` - `hg push`
* `hgs` - `hg status`
* `hgsl` - `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"`
###### this is the 'git commit --amend' equivalent
* `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)
* `hgun` - `hg resolve --list`
#### Displays repo branch and directory status in prompt
This is the same as git plugin does.
**Note**: additional changes to **.zshrc** are required in order for this to
work.
### Mantainers
[ptrv](https://github.com/ptrv) - original creator
[oshybystyi](https://github.com/oshybystyi) - created this README and know how most of code works

View file

@ -35,7 +35,7 @@ function hg_prompt_info {
if [ $(in_hg) ]; then if [ $(in_hg) ]; then
_DISPLAY=$(hg_get_branch_name) _DISPLAY=$(hg_get_branch_name)
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\ 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 unset _DISPLAY
fi fi
} }

View file

@ -0,0 +1,28 @@
# mix-fast
Fast mix autocompletion plugin.
This script caches the output for later usage and significantly speeds it up.
It generates a .mix_tasks cache file for current project. Currently if you want
to update cache you should remove .mix_tasks file
Inspired by and based on rake-fast zsh plugin.
This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/).
## Installation
Just add the plugin to your `.zshrc`:
```bash
plugins=(foo bar mix-fast)
```
You might consider adding `.mix_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore)
## Usage
`mix`, then press tab
Currently maintained by [styx](https://github.com/styx/)

View file

@ -0,0 +1,29 @@
_mix_refresh () {
if [ -f .mix_tasks ]; then
rm .mix_tasks
fi
echo "Generating .mix_tasks..." > /dev/stderr
_mix_generate
cat .mix_tasks
}
_mix_does_task_list_need_generating () {
[ ! -f .mix_tasks ];
}
_mix_generate () {
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
}
_mix () {
if [ -f mix.exs ]; then
if _mix_does_task_list_need_generating; then
echo "\nGenerating .mix_tasks..." > /dev/stderr
_mix_generate
fi
compadd `cat .mix_tasks`
fi
}
compdef _mix mix
alias mix_refresh='_mix_refresh'

View file

@ -1,27 +1,43 @@
#compdef mix #compdef mix
#autoload #autoload
# Elixir mix zsh completion # Elixir mix zsh completion
local -a _1st_arguments local -a _1st_arguments
_1st_arguments=( _1st_arguments=(
'archive:Archive this project into a .ez file' 'app.start:Start all registered apps'
'clean:Clean generated application files' 'archive:List all archives'
'archive.build:Archive this project into a .ez file'
'archive.install:Install an archive locally'
'archive.uninstall:Uninstall archives'
'clean:Delete generated application files'
'cmd:Executes the given command'
'compile:Compile source files' 'compile:Compile source files'
'compile.protocols:Consolidates all protocols in all paths'
'deps:List dependencies and their status' 'deps:List dependencies and their status'
"deps.clean:Remove dependencies' files" "deps.clean:Remove the given dependencies' files"
'deps.compile:Compile dependencies' 'deps.compile:Compile dependencies'
'deps.get:Get all out of date dependencies' 'deps.get:Get all out of date dependencies'
'deps.unlock:Unlock the given dependencies' 'deps.unlock:Unlock the given dependencies'
'deps.update:Update dependencies' 'deps.update:Update the given dependencies'
'do:Executes the commands separated by comma' 'do:Executes the tasks separated by comma'
'escriptize:Generates an escript for the project' 'escript.build:Builds an escript for the project'
'help:Print help information for tasks' 'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
'hex.docs:Publish docs for package'
'hex.info:Print hex information'
'hex.key:Hex API key tasks'
'hex.outdated:Shows outdated hex deps for the current project'
'hex.owner:Hex package ownership tasks'
'hex.publish:Publish a new package version'
'hex.search:Search for package names'
'hex.user:Hex user tasks'
'loadconfig:Loads and persists the given configuration'
'local:List local tasks' 'local:List local tasks'
'local.install:Install a task or an archive locally' 'local.hex:Install hex locally'
'local.rebar:Install rebar locally' 'local.rebar:Install rebar locally'
'local.uninstall:Uninstall local tasks or archives' 'new:Create a new Elixir project'
'new:Creates a new Elixir project'
'run:Run the given file or expression' 'run:Run the given file or expression'
"test:Run a project's tests" "test:Run a project's tests"
'--help:Describe available tasks' '--help:Describe available tasks'
@ -33,7 +49,7 @@ __task_list ()
local expl local expl
declare -a tasks declare -a tasks
tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test) tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new run test)
_wanted tasks expl 'help' compadd $tasks _wanted tasks expl 'help' compadd $tasks
} }
@ -56,7 +72,7 @@ case $state in
(options) (options)
case $line[1] in case $line[1] in
(help) (help)
_arguments ':feature:__task_list' _arguments ':feature:__task_list'
esac esac
;; ;;
esac esac

View file

@ -60,6 +60,8 @@ alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run' alias mvnjetty='mvn jetty:run'
alias mvndt='mvn dependency:tree' alias mvndt='mvn dependency:tree'
alias mvns='mvn site' alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
function listMavenCompletions { function listMavenCompletions {
reply=( reply=(

View file

@ -0,0 +1,34 @@
# ------------------------------------------------------------------------------
# FILE: n98-magerun.plugin.zsh
# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin
# AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# n98-magerun basic command completion
_n98_magerun_get_command_list () {
$_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
}
_n98_magerun () {
_arguments '1: :->command' '*:optional arg:_files'
case $state in
command)
compadd $(_n98_magerun_get_command_list)
;;
*)
esac
}
compdef _n98_magerun n98-magerun.phar
compdef _n98_magerun n98-magerun
# Aliases
alias n98='n98-magerun.phar'
alias mage='n98-magerun.phar'
alias magefl='n98-magerun.phar cache:flush'
# Install n98-magerun into the current directory
alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'

32
plugins/nmap/README.md Normal file
View file

@ -0,0 +1,32 @@
# Nmap aliases plugin
Adds some useful aliases for nmap similar to the profiles in zenmap.
Nmap options are:
* -sS - TCP SYN scan
* -v - verbose
* -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
* -sF - FIN scan (can sneak through non-stateful firewalls)
* -PE - ICMP echo discovery probe
* -PP - timestamp discovery probe
* -PY - SCTP init ping
* -g - use given number as source port
* -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
* -O - enable OS detection
* -sA - TCP ACK scan
* -F - fast scan
* --script=vulscan - also access vulnerabilities in target
## Aliases explained
* nmap_open_ports - scan for open ports on target
* nmap_list_interfaces - list all network interfaces on host where the command runs
* nmap_slow - slow scan that avoids to spam the targets logs
* nmap_fin - scan to see if hosts are up with TCP FIN scan
* nmap_full - aggressive full scan that scans all ports, tries to determine OS and service versions
* nmap_check_for_firewall - TCP ACK scan to check for firewall existence
* nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
restrictions
* nmap_fast - Fast scan of the top 300 popular ports
* nmap_detect_versions - detects versions of services and OS, runs on all ports
* nmap_check_for_vulns - uses vulscan script to check target services for vulnerabilities

View file

@ -0,0 +1,28 @@
# Some useful nmap aliases for scan modes
# Nmap options are:
# -sS - TCP SYN scan
# -v - verbose
# -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
# -sF - FIN scan (can sneak through non-stateful firewalls)
# -PE - ICMP echo discovery probe
# -PP - timestamp discovery probe
# -PY - SCTP init ping
# -g - use given number as source port
# -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
# -O - enable OS detection
# -sA - TCP ACK scan
# -F - fast scan
# --script=vulscan - also access vulnerabilities in target
alias nmap_open_ports="nmap --open"
alias nmap_list_interfaces="nmap --iflist"
alias nmap_slow="nmap -sS -v -T1"
alias nmap_fin="nmap -sF -v"
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
alias nmap_ping_through_firewall="nmap -PS -PA"
alias nmap_fast="nmap -F -T5 --top-ports 300"
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vulscan"

View file

@ -1,13 +1,5 @@
# Open the node api for your current version to the optional section. # Open the node api for your current version to the optional section.
# TODO: Make the section part easier to use. # TODO: Make the section part easier to use.
function node-docs { function node-docs {
# get the open command open_command "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
local open_cmd
if [[ "$OSTYPE" = darwin* ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
fi
$open_cmd "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
} }

View file

@ -1 +1,14 @@
eval "$(npm completion 2>/dev/null)" eval "$(npm completion 2>/dev/null)"
# npm package names are lowercase
# - https://twitter.com/substack/status/23122603153150361
# Thus, we've used camelCase for the following aliases:
# Install and save to dependencies in your package.json
# npms is used by https://www.npmjs.com/package/npms
alias npmS="npm i -S "
# Install and save to dev-dependencies in your package.json
# npmd is used by https://github.com/dominictarr/npmd
alias npmD="npm i -D "

View file

@ -35,6 +35,7 @@ EOF
set current_session to current session set current_session to current session
tell current_session tell current_session
write text "${command}" write text "${command}"
keystroke return
end tell end tell
end tell end tell
end tell end tell
@ -137,23 +138,6 @@ function man-preview() {
man -t "$@" | open -f -a Preview man -t "$@" | open -f -a Preview
} }
function trash() {
local trash_dir="${HOME}/.Trash"
local temp_ifs="$IFS"
IFS=$'\n'
for item in "$@"; do
if [[ -e "$item" ]]; then
item_name="$(basename $item)"
if [[ -e "${trash_dir}/${item_name}" ]]; then
mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")"
else
mv -f "$item" "${trash_dir}/"
fi
fi
done
IFS=$temp_ifs
}
function vncviewer() { function vncviewer() {
open vnc://$@ open vnc://$@
} }

View file

@ -0,0 +1,16 @@
_paver_does_target_list_need_generating () {
[ ! -f .paver_targets ] && return 0;
[ pavement.py -nt .paver_targets ] && return 0;
return 1;
}
_paver () {
if [ -f pavement.py ]; then
if _paver_does_target_list_need_generating; then
paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets
fi
compadd `cat .paver_targets`
fi
}
compdef _paver paver

View file

@ -27,7 +27,7 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe
# Functions ################################################################# # 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 () { newpl () {
# set $EDITOR to 'vim' if it is undefined # set $EDITOR to 'vim' if it is undefined
[[ -z $EDITOR ]] && EDITOR=vim [[ -z $EDITOR ]] && EDITOR=vim
@ -54,9 +54,3 @@ pgs() { # [find] [replace] [filename]
prep() { # [pattern] [filename unless STDOUT] prep() { # [pattern] [filename unless STDOUT]
perl -nle 'print if /'"$1"'/;' $2 perl -nle 'print if /'"$1"'/;' $2
} }
# say - append a newline to 'print'
say() {
print "$1\n"
}

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more