Installed Oh-My-Zsh, slight polybar change (brightness)

This commit is contained in:
Salt 2017-08-15 01:39:00 -05:00
parent 4ba9563c43
commit dd7aa6f5db
586 changed files with 45683 additions and 31 deletions

View File

@ -9,7 +9,8 @@
;========================================
[res/colors]
background = ${xrdb:background:#1d2021}
background-alt = ${xrdb:bg2:#504945}
background-med = ${xrdb:bg1:#282828}
background-soft = ${xrdb:bg2:#504945}
foreground = ${xrdb:color15:#ebdbb2}
foreground-alt = ${xrdb:color8:#928374}
@ -83,7 +84,7 @@ border-top-color = ${res/colors.accent-control}
modules-left = battery cpu memory
modules-center = mpd
modules-right = xbacklight volume temperature
modules-right = backlight volume temperature
;========================================
; MODULES
@ -121,7 +122,7 @@ bar-indicator = |
bar-indicator-foreground = ${res/colors.foreground}
bar-indicator-background = ${res/colors.background}
bar-empty = |
bar-empty-foreground = ${res/colors.background-alt}
bar-empty-foreground = ${res/colors.background-soft}
bar-empty-background = ${res/colors.background}
[template/module/network]
@ -242,6 +243,7 @@ date-alt = %A, %B %d
time-alt = %I:%M %p
label = %date% %time%
label-padding = 2
label-foreground = ${res/colors.foreground}
label-background = ${res/colors.background}
@ -280,8 +282,8 @@ label-song-background = ${res/colors.background}
label-song-maxlen = 25
label-song-ellipsis = true
label-offline = "SALT"
label-offline-foreground = ${res/colors.foreground}
label-offline = "Disconnected from MPD"
label-offline-foreground = ${res/colors.background-soft}
label-offline-background = ${res/colors.background}
label-time = %elapsed%/%total%
@ -329,7 +331,7 @@ label-volume-background = ${template/module/bar.label-background}
label-muted = "V"
label-muted-padding = ${self.label-volume-padding}
label-muted-foreground = ${res/colors.background}
label-muted-background = ${res/colors.background-alt}
label-muted-background = ${res/colors.background-soft}
bar-volume-width = ${template/module/bar.bar-width}
bar-volume-fill = ${template/module/bar.bar-fill}
@ -357,10 +359,12 @@ label-connected = %downspeed%
label-connected-foreground = ${res/colors.accent-control-dark}
label-connected-background = ${res/colors.background}
[module/xbacklight]
type = internal/xbacklight
[module/backlight]
type = internal/backlight
inherit = template/module/bar
label = BRI
card = intel_backlight
label = B
bar-fill-foreground = ${template/module/bar.bar-fill-foreground-setting}
[module/xkeyboard]

123
.oh-my-zsh/CONTRIBUTING.md Normal file
View File

@ -0,0 +1,123 @@
# CONTRIBUTING GUIDELINES
Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated.
It is also essential for the development of the project.
These guidelines are an attempt at better addressing the huge amount of pending
issues and pull requests. Please read them closely.
Foremost, be so kind as to [search](#use-the-search-luke). This ensures any contribution
you would make is not already covered.
* [Issues](#reporting-issues)
* [You have a problem](#you-have-a-problem)
* [You have a suggestion](#you-have-a-suggestion)
* [Pull Requests](#submitting-pull-requests)
* [Getting started](#getting-started)
* [You have a solution](#you-have-a-solution)
* [You have an addition](#you-have-an-addition)
* [Information sources (_aka_ search)](#use-the-search-luke)
**BONUS:** [Volunteering](#you-have-spare-time-to-volunteer)
## Reporting Issues
### You have a problem
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
your problem.
If you find one, comment on it so we can know there are more people experiencing it.
If not, look at the [Troubleshooting](https://github.com/robbyrussell/oh-my-zsh/wiki/Troubleshooting)
page for instructions on how to gather data to better debug your problem.
Then, you can go ahead and create an issue with as much detail as you can provide.
It should include the data gathered as indicated above, along with:
1. How to reproduce the problem
2. What the correct behavior should be
3. What the actual behavior is
Please copy to anyone relevant (_eg_ plugin maintainers) by mentioning their GitHub handle
(starting with `@`) in your message.
We will do our very best to help you.
### You have a suggestion
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
your suggestion.
If you find one, comment on it so we can know there are more people supporting it.
If not, you can go ahead and create an issue. Please copy to anyone relevant (_eg_ plugin
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
## Submitting Pull Requests
### Getting started
You should be familiar with the basics of
[contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork
[properly set up](https://github.com/robbyrussell/oh-my-zsh/wiki/Contribution-Technical-Practices).
You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree.
If you create your own PR, please make sure you do it right. Also be so kind as to reference
any issue that would be solved in the PR description body,
[for instance](https://help.github.com/articles/closing-issues-via-commit-messages/)
_"Fixes #XXXX"_ for issue number XXXX.
### You have a solution
Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
your [problem](#you-have-a-problem), and any pending/merged/rejected PR covering your solution.
If the solution is already reported, try it out and +1 the pull request if the
solution works ok. On the other hand, if you think your solution is better, post
it with a reference to the other one so we can have both solutions to compare.
If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
### You have an addition
Please [do not](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#dont-send-us-your-theme-for-now)
send themes for now.
Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests
covering or related to what you want to add.
If you find one, try it out and work with the author on a common solution.
If not, then go ahead and submit a PR. Please copy to anyone relevant (_eg_ plugin
maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
For any extensive change, _eg_ a new plugin, you will have to find testers to +1 your PR.
----
## Use the Search, Luke
_May the Force (of past experiences) be with you_
GitHub offers [many search features](https://help.github.com/articles/searching-github/)
to help you check whether a similar contribution to yours already exists. Please search
before making any contribution, it avoids duplicates and eases maintenance. Trust me,
that works 90% of the time.
You can also take a look at the [FAQ](https://github.com/robbyrussell/oh-my-zsh/wiki/FAQ)
to be sure your contribution has not already come up.
If all fails, your thing has probably not been reported yet, so you can go ahead
and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests).
----
### You have spare time to volunteer
Very nice!! :)
Please have a look at the [Volunteer](https://github.com/robbyrussell/oh-my-zsh/wiki/Volunteers)
page for instructions on where to start and more.

22
.oh-my-zsh/LICENSE.txt Normal file
View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2009-2017 Robby Russell and contributors
See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

230
.oh-my-zsh/README.md Normal file
View File

@ -0,0 +1,230 @@
<p align="center">
<img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
</p>
Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration.
Sounds boring. Let's try again.
__Oh My Zsh will not make you a 10x developer...but you might feel like one.__
Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful 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 have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often.
To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
### Prerequisites
__Disclaimer:__ _Oh My Zsh works best on macOS and Linux._
* Unix-like operating system (macOS 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
```shell
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```
#### via wget
```shell
sh -c "$(wget https://raw.githubusercontent.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
Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the `.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load.
For example, this line might begin to look like this:
```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 the right one (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, simply change the value to match the name of your desired theme. For example:
```shell
ZSH_THEME="agnoster" # (this is one of the fancy ones)
# you might need to install a special Powerline font on your console's host for this to work
# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster
```
Open up a new terminal window and your prompt should look something like this:
![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).
If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
```shell
ZSH_THEME="random" # (...please let it be pie... please be some pie..)
```
## 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
export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```
#### Manual Installation
##### 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 have 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're on the social media.
* [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. You should follow it.
* [Oh My Zsh](https://www.facebook.com/Oh-My-Zsh-296616263819290/) on Facebook.
## 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](LICENSE.txt).
## About Planet Argon
![Planet Argon](http://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg)
Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/skills/ruby-on-rails-development?utm_source=github).

10
.oh-my-zsh/lib/bzr.zsh Normal file
View File

@ -0,0 +1,10 @@
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}

View File

@ -0,0 +1,86 @@
# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other
# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the
# "system clipboard", and the X Windows `xclip` command must be installed.
# clipcopy - Copy data to clipboard
#
# Usage:
#
# <command> | clipcopy - copies stdin to clipboard
#
# clipcopy <file> - copies a file's contents to clipboard
#
function clipcopy() {
emulate -L zsh
local file=$1
if [[ $OSTYPE == darwin* ]]; then
if [[ -z $file ]]; then
pbcopy
else
cat $file | pbcopy
fi
elif [[ $OSTYPE == cygwin* ]]; then
if [[ -z $file ]]; then
cat > /dev/clipboard
else
cat $file > /dev/clipboard
fi
else
if (( $+commands[xclip] )); then
if [[ -z $file ]]; then
xclip -in -selection clipboard
else
xclip -in -selection clipboard $file
fi
elif (( $+commands[xsel] )); then
if [[ -z $file ]]; then
xsel --clipboard --input
else
cat "$file" | xsel --clipboard --input
fi
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# clippaste - "Paste" data from clipboard to stdout
#
# Usage:
#
# clippaste - writes clipboard's contents to stdout
#
# clippaste | <command> - pastes contents and pipes it to another process
#
# clippaste > <file> - paste contents to a file
#
# Examples:
#
# # Pipe to another process
# clippaste | grep foo
#
# # Paste to a file
# clippaste > file.txt
function clippaste() {
emulate -L zsh
if [[ $OSTYPE == darwin* ]]; then
pbpaste
elif [[ $OSTYPE == cygwin* ]]; then
cat /dev/clipboard
else
if (( $+commands[xclip] )); then
xclip -out -selection clipboard
elif (( $+commands[xsel] )); then
xsel --clipboard --output
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}

View File

@ -0,0 +1,60 @@
# Handle completions insecurities (i.e., completion-dependent directories with
# insecure ownership or permissions) by:
#
# * Human-readably notifying the user of these insecurities.
# * Moving away all existing completion caches to a temporary directory. Since
# any of these caches may have been generated from insecure directories, they
# are all suspect now. Failing to do so typically causes subsequent compinit()
# calls to fail with "command not found: compdef" errors. (That's bad.)
function handle_completion_insecurities() {
# List of the absolute paths of all unique insecure directories, split on
# newline from compaudit()'s output resembling:
#
# There are insecure directories:
# /usr/share/zsh/site-functions
# /usr/share/zsh/5.0.6/functions
# /usr/share/zsh
# /usr/share/zsh/5.0.6
#
# Since the ignorable first line is printed to stderr and thus not captured,
# stderr is squelched to prevent this output from leaking to the user.
local -aU insecure_dirs
insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
# If no such directories exist, get us out of here.
if (( ! ${#insecure_dirs} )); then
print "[oh-my-zsh] No insecure completion-dependent directories detected."
return
fi
# List ownership and permissions of all insecure directories.
print "[oh-my-zsh] Insecure completion-dependent directories detected:"
ls -ld "${(@)insecure_dirs}"
print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
# Locally enable the "NULL_GLOB" option, thus removing unmatched filename
# globs from argument lists *AND* printing no warning when doing so. Failing
# to do so prints an unreadable warning if no completion caches exist below.
setopt local_options null_glob
# List of the absolute paths of all unique existing completion caches.
local -aU zcompdump_files
zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
# Move such caches to a temporary directory.
if (( ${#zcompdump_files} )); then
# Absolute path of the directory to which such files will be moved.
local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
# List such files first.
print "[oh-my-zsh] Insecure completion caches also detected:"
ls -l "${(@)zcompdump_files}"
# For safety, move rather than permanently remove such files.
print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
fi
}

View File

@ -0,0 +1,70 @@
# fixme - the load process here seems a bit bizarre
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
# case insensitive (all), partial-word and substring completion
if [[ "$CASE_SENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
else
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
fi
fi
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
if [[ "$OSTYPE" = solaris* ]]; then
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
else
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
usbmux uucp vcsa wwwrun xfs '_*'
# ... unless we really want to.
zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi

View File

@ -0,0 +1,13 @@
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias sudo='nocorrect sudo'
setopt correct_all
fi

View File

@ -0,0 +1,353 @@
# diagnostics.zsh
#
# Diagnostic and debugging support for oh-my-zsh
# omz_diagnostic_dump()
#
# Author: Andrew Janke <andrew@apjanke.net>
#
# Usage:
#
# omz_diagnostic_dump [-v] [-V] [file]
#
# NOTE: This is a work in progress. Its interface and behavior are going to change,
# and probably in non-back-compatible ways.
#
# Outputs a bunch of information about the state and configuration of
# oh-my-zsh, zsh, and the user's system. This is intended to provide a
# bunch of context for diagnosing your own or a third party's problems, and to
# be suitable for posting to public bug reports.
#
# The output is human-readable and its format may change over time. It is not
# suitable for parsing. All the output is in one single file so it can be posted
# as a gist or bug comment on GitHub. GitHub doesn't support attaching tarballs
# or other files to bugs; otherwise, this would probably have an option to produce
# tarballs that contain copies of the config and customization files instead of
# catting them all in to one file.
#
# This is intended to be widely portable, and run anywhere that oh-my-zsh does.
# Feel free to report any portability issues as bugs.
#
# This is written in a defensive style so it still works (and can detect) cases when
# basic functionality like echo and which have been redefined. In particular, almost
# everything is invoked with "builtin" or "command", to work in the face of user
# redefinitions.
#
# OPTIONS
#
# [file] Specifies the output file. If not given, a file in the current directory
# is selected automatically.
#
# -v Increase the verbosity of the dump output. May be specified multiple times.
# Verbosity levels:
# 0 - Basic info, shell state, omz configuration, git state
# 1 - (default) Adds key binding info and configuration file contents
# 2 - Adds zcompdump file contents
#
# -V Reduce the verbosity of the dump output. May be specified multiple times.
#
# TODO:
# * Multi-file capture
# * Add automatic gist uploading
# * Consider whether to move default output file location to TMPDIR. More robust
# but less user friendly.
#
autoload -Uz is-at-least
function omz_diagnostic_dump() {
emulate -L zsh
builtin echo "Generating diagnostic dump; please be patient..."
local thisfcn=omz_diagnostic_dump
local -A opts
local opt_verbose opt_noverbose opt_outfile
local timestamp=$(date +%Y%m%d-%H%M%S)
local outfile=omz_diagdump_$timestamp.txt
builtin zparseopts -A opts -D -- "v+=opt_verbose" "V+=opt_noverbose"
local verbose n_verbose=${#opt_verbose} n_noverbose=${#opt_noverbose}
(( verbose = 1 + n_verbose - n_noverbose ))
if [[ ${#*} > 0 ]]; then
opt_outfile=$1
fi
if [[ ${#*} > 1 ]]; then
builtin echo "$thisfcn: error: too many arguments" >&2
return 1
fi
if [[ -n "$opt_outfile" ]]; then
outfile="$opt_outfile"
fi
# Always write directly to a file so terminal escape sequences are
# captured cleanly
_omz_diag_dump_one_big_text &> "$outfile"
if [[ $? != 0 ]]; then
builtin echo "$thisfcn: error while creating diagnostic dump; see $outfile for details"
fi
builtin echo
builtin echo Diagnostic dump file created at: "$outfile"
builtin echo
builtin echo To share this with OMZ developers, post it as a gist on GitHub
builtin echo at "https://gist.github.com" and share the link to the gist.
builtin echo
builtin echo "WARNING: This dump file contains all your zsh and omz configuration files,"
builtin echo "so don't share it publicly if there's sensitive information in them."
builtin echo
}
function _omz_diag_dump_one_big_text() {
local program programs progfile md5
builtin echo oh-my-zsh diagnostic dump
builtin echo
builtin echo $outfile
builtin echo
# Basic system and zsh information
command date
command uname -a
builtin echo OSTYPE=$OSTYPE
builtin echo ZSH_VERSION=$ZSH_VERSION
builtin echo User: $USER
builtin echo umask: $(umask)
builtin echo
_omz_diag_dump_os_specific_version
builtin echo
# Installed programs
programs=(sh zsh ksh bash sed cat grep ls find git posh)
local progfile="" extra_str="" sha_str=""
for program in $programs; do
extra_str="" sha_str=""
progfile=$(builtin which $program)
if [[ $? == 0 ]]; then
if [[ -e $progfile ]]; then
if builtin whence shasum &>/dev/null; then
sha_str=($(command shasum $progfile))
sha_str=$sha_str[1]
extra_str+=" SHA $sha_str"
fi
if [[ -h "$progfile" ]]; then
extra_str+=" ( -> ${progfile:A} )"
fi
fi
builtin printf '%-9s %-20s %s\n' "$program is" "$progfile" "$extra_str"
else
builtin echo "$program: not found"
fi
done
builtin echo
builtin echo Command Versions:
builtin echo "zsh: $(zsh --version)"
builtin echo "this zsh session: $ZSH_VERSION"
builtin echo "bash: $(bash --version | command grep bash)"
builtin echo "git: $(git --version)"
builtin echo "grep: $(grep --version)"
builtin echo
# Core command definitions
_omz_diag_dump_check_core_commands || return 1
builtin echo
# ZSH Process state
builtin echo Process state:
builtin echo pwd: $PWD
if builtin whence pstree &>/dev/null; then
builtin echo Process tree for this shell:
pstree -p $$
else
ps -fT
fi
builtin set | command grep -a '^\(ZSH\|plugins\|TERM\|LC_\|LANG\|precmd\|chpwd\|preexec\|FPATH\|TTY\|DISPLAY\|PATH\)\|OMZ'
builtin echo
#TODO: Should this include `env` instead of or in addition to `export`?
builtin echo Exported:
builtin echo $(builtin export | command sed 's/=.*//')
builtin echo
builtin echo Locale:
command locale
builtin echo
# Zsh installation and configuration
builtin echo Zsh configuration:
builtin echo setopt: $(builtin setopt)
builtin echo
builtin echo zstyle:
builtin zstyle
builtin echo
builtin echo 'compaudit output:'
compaudit
builtin echo
builtin echo '$fpath directories:'
command ls -lad $fpath
builtin echo
# Oh-my-zsh installation
builtin echo oh-my-zsh installation:
command ls -ld ~/.z*
command ls -ld ~/.oh*
builtin echo
builtin echo oh-my-zsh git state:
(cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]")
if [[ $verbose -ge 1 ]]; then
(cd $ZSH && git reflog --date=default | command grep pull)
fi
builtin echo
if [[ -e $ZSH_CUSTOM ]]; then
local custom_dir=$ZSH_CUSTOM
if [[ -h $custom_dir ]]; then
custom_dir=$(cd $custom_dir && pwd -P)
fi
builtin echo "oh-my-zsh custom dir:"
builtin echo " $ZSH_CUSTOM ($custom_dir)"
(cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print)
builtin echo
fi
# Key binding and terminal info
if [[ $verbose -ge 1 ]]; then
builtin echo "bindkey:"
builtin bindkey
builtin echo
builtin echo "infocmp:"
command infocmp -L
builtin echo
fi
# Configuration file info
local zdotdir=${ZDOTDIR:-$HOME}
builtin echo "Zsh configuration files:"
local cfgfile cfgfiles
# Some files for bash that zsh does not use are intentionally included
# to help with diagnosing behavior differences between bash and zsh
cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout
$zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout
~/.zsh.pre-oh-my-zsh
/etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout )
command ls -lad $cfgfiles 2>&1
builtin echo
if [[ $verbose -ge 1 ]]; then
for cfgfile in $cfgfiles; do
_omz_diag_dump_echo_file_w_header $cfgfile
done
fi
builtin echo
builtin echo "Zsh compdump files:"
local dumpfile dumpfiles
command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) )
if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile
done
fi
}
function _omz_diag_dump_check_core_commands() {
builtin echo "Core command check:"
local redefined name builtins externals reserved_words
redefined=()
# All the zsh non-module builtin commands
# These are taken from the zsh reference manual for 5.0.2
# Commands from modules should not be included.
# (For back-compatibility, if any of these are newish, they should be removed,
# or at least made conditional on the version of the current running zsh.)
# "history" is also excluded because OMZ is known to redefine that
reserved_words=( do done esac then elif else fi for case if while function
repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}'
)
builtins=( alias autoload bg bindkey break builtin bye cd chdir command
comparguments compcall compctl compdescribe compfiles compgroups compquote comptags
comptry compvalues continue dirs disable disown echo echotc echoti emulate
enable eval exec exit false fc fg functions getln getopts hash
jobs kill let limit log logout noglob popd print printf
pushd pushln pwd r read rehash return sched set setopt shift
source suspend test times trap true ttyctl type ulimit umask unalias
unfunction unhash unlimit unset unsetopt vared wait whence where which zcompile
zle zmodload zparseopts zregexparse zstyle )
if is-at-least 5.1; then
reserved_word+=( declare export integer float local readonly typeset )
else
builtins+=( declare export integer float local readonly typeset )
fi
builtins_fatal=( builtin command local )
externals=( zsh )
for name in $reserved_words; do
if [[ $(builtin whence -w $name) != "$name: reserved" ]]; then
builtin echo "reserved word '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $builtins; do
if [[ $(builtin whence -w $name) != "$name: builtin" ]]; then
builtin echo "builtin '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $externals; do
if [[ $(builtin whence -w $name) != "$name: command" ]]; then
builtin echo "command '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
if [[ -n "$redefined" ]]; then
builtin echo "SOME CORE COMMANDS HAVE BEEN REDEFINED: $redefined"
else
builtin echo "All core commands are defined normally"
fi
}
function _omz_diag_dump_echo_file_w_header() {
local file=$1
if [[ ( -f $file || -h $file ) ]]; then
builtin echo "========== $file =========="
if [[ -h $file ]]; then
builtin echo "========== ( => ${file:A} ) =========="
fi
command cat $file
builtin echo "========== end $file =========="
builtin echo
elif [[ -d $file ]]; then
builtin echo "File '$file' is a directory"
elif [[ ! -e $file ]]; then
builtin echo "File '$file' does not exist"
else
command ls -lad "$file"
fi
}
function _omz_diag_dump_os_specific_version() {
local osname osver version_file version_files
case "$OSTYPE" in
darwin*)
osname=$(command sw_vers -productName)
osver=$(command sw_vers -productVersion)
builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)"
;;
cygwin)
command systeminfo | command head -4 | command tail -2
;;
esac
if builtin which lsb_release >/dev/null; then
builtin echo "OS Release: $(command lsb_release -s -d)"
fi
version_files=( /etc/*-release(N) /etc/*-version(N) /etc/*_version(N) )
for version_file in $version_files; do
builtin echo "$version_file:"
command cat "$version_file"
builtin echo
done
}

View File

@ -0,0 +1,34 @@
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='cd -7'
alias 8='cd -8'
alias 9='cd -9'
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
# List directory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'

View File

@ -0,0 +1,231 @@
function zsh_stats() {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
}
function take() {
mkdir -p $1
cd $1
}
function open_command() {
emulate -L zsh
setopt shwordsplit
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
linux*) open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
$open_cmd "$@" &>/dev/null
else
nohup $open_cmd "$@" &>/dev/null
fi
}
#
# Get the value of an alias.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1 (if it has one).
# Return value:
# 0 if the alias was found,
# 1 if it does not exist
#
function alias_value() {
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
test $(alias "$1")
}
#
# Try to get the value of an alias,
# otherwise return the input.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1, or $1 if there is no alias $1.
# Return value:
# Always 0
#
function try_alias_value() {
alias_value "$1" || echo "$1"
}
#
# Set variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The variable to set
# 2. val - The default value
# Return value:
# 0 if the variable exists, 3 if it was set
#
function default() {
test `typeset +m "$1"` && return 0
typeset -g "$1"="$2" && return 3
}
#
# Set environment variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The env variable to set
# 2. val - The default value
# Return value:
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
env | grep -q "^$1=" && return 0
export "$1=$2" && return 3
}
# Required for $langinfo
zmodload zsh/langinfo
# URL-encode a string
#
# Encodes a string using RFC 2396 URL-encoding (%-escaped).
# See: https://www.ietf.org/rfc/rfc2396.txt
#
# By default, reserved characters and unreserved "mark" characters are
# not escaped by this function. This allows the common usage of passing
# an entire URL in, and encoding just special characters in it, with
# the expectation that reserved and mark characters are used appropriately.
# The -r and -m options turn on escaping of the reserved and mark characters,
# respectively, which allows arbitrary strings to be fully escaped for
# embedding inside URLs, where reserved characters might be misinterpreted.
#
# Prints the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urlencode [-r] [-m] [-P] <string>
#
# -r causes reserved characters (;/?:@&=+$,) to be escaped
#
# -m causes "mark" characters (_.!~*''()-) to be escaped
#
# -P causes spaces to be encoded as '%20' instead of '+'
function omz_urlencode() {
emulate -L zsh
zparseopts -D -E -a opts r m P
local in_str=$1
local url_str=""
local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
local str="$in_str"
# URLs must use UTF-8 encoding; convert str to UTF-8 if required
local encoding=$langinfo[CODESET]
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
if [[ $? != 0 ]]; then
echo "Error converting string from $encoding to UTF-8" >&2
return 1
fi
fi
# Use LC_CTYPE=C to process text byte-by-byte
local i byte ord LC_ALL=C
export LC_ALL
local reserved=';/?:@&=+$,'
local mark='_.!~*''()-'
local dont_escape="[A-Za-z0-9"
if [[ -z $opts[(r)-r] ]]; then
dont_escape+=$reserved
fi
# $mark must be last because of the "-"
if [[ -z $opts[(r)-m] ]]; then
dont_escape+=$mark
fi
dont_escape+="]"
# Implemented to use a single printf call and avoid subshells in the loop,
# for performance (primarily on Windows).
local url_str=""
for (( i = 1; i <= ${#str}; ++i )); do
byte="$str[i]"
if [[ "$byte" =~ "$dont_escape" ]]; then
url_str+="$byte"
else
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
url_str+="+"
else
ord=$(( [##16] #byte ))
url_str+="%$ord"
fi
fi
done
echo -E "$url_str"
}
# URL-decode a string
#
# Decodes a RFC 2396 URL-encoded (%-escaped) string.
# This decodes the '+' and '%' escapes in the input string, and leaves
# other characters unchanged. Does not enforce that the input is a
# valid URL-encoded string. This is a convenience to allow callers to
# pass in a full URL or similar strings and decode them for human
# presentation.
#
# Outputs the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urldecode <urlstring> - prints decoded string followed by a newline
function omz_urldecode {
emulate -L zsh
local encoded_url=$1
# Work bytewise, since URLs escape UTF-8 octets
local caller_encoding=$langinfo[CODESET]
local LC_ALL=C
export LC_ALL
# Change + back to ' '
local tmp=${encoded_url:gs/+/ /}
# Protect other escapes to pass through the printf unchanged
tmp=${tmp:gs/\\/\\\\/}
# Handle %-escapes by turning them into `\xXX` printf escapes
tmp=${tmp:gs/%/\\x/}
local decoded
eval "decoded=\$'$tmp'"
# Now we have a UTF-8 encoded string in the variable. We need to re-encode
# it if caller is in a non-UTF-8 locale.
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$caller_encoding]} ]]; then
decoded=$(echo -E "$decoded" | iconv -f UTF-8 -t $caller_encoding)
if [[ $? != 0 ]]; then
echo "Error converting string from UTF-8 to $caller_encoding" >&2
return 1
fi
fi
echo -E "$decoded"
}

217
.oh-my-zsh/lib/git.zsh Normal file
View File

@ -0,0 +1,217 @@
# Outputs current branch info in prompt format
function git_prompt_info() {
local ref
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
# Checks if working tree is dirty
function parse_git_dirty() {
local STATUS=''
local FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}
# Gets the difference between the local and remote branches
function git_remote_status() {
local remote ahead behind git_remote_status git_remote_status_detailed
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]]; then
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi
if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
fi
echo $git_remote_status
fi
}
# Outputs the name of the current branch
# Usage example: git pull origin $(git_current_branch)
# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
# it's not a symbolic ref, but in a Git repo.
function git_current_branch() {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
}
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count @{upstream}..HEAD)"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
fi
}
# Gets the number of commits behind remote
function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count HEAD..@{upstream})"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
fi
}
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(git_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
function git_prompt_short_sha() {
local SHA
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
local SHA
SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
function git_prompt_status() {
local INDEX STATUS
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
}
# Compares the provided version of git to the version installed and on path
# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
# greater than the input version, respectively.
function git_compare_version() {
local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)1})
INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
echo 1
return 0
fi
if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
echo -1
return 0
fi
done
echo 0
}
# Outputs the name of the current user
# Usage example: $(git_current_user_name)
function git_current_user_name() {
command git config user.name 2>/dev/null
}
# Outputs the email of the current user
# Usage example: $(git_current_user_email)
function git_current_user_email() {
command git config user.email 2>/dev/null
}
# This is unlikely to change so make it all statically assigned
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
# Clean up the namespace slightly by removing the checker function
unfunction git_compare_version

28
.oh-my-zsh/lib/grep.zsh Normal file
View File

@ -0,0 +1,28 @@
# is x grep argument available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
GREP_OPTIONS=""
# color grep results
if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
fi
# export grep settings
alias grep="grep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
unset VCS_FOLDERS
unfunction grep-flag-available

View File

@ -0,0 +1,24 @@
## Command history configuration
if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
# Show history
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;;
*) alias history='fc -l 1' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data

View File

@ -0,0 +1,93 @@
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
bindkey -e # Use emacs key bindings
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
if [[ "${terminfo[kpp]}" != "" ]]; then
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
fi
if [[ "${terminfo[knp]}" != "" ]]; then
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
fi
# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
if [[ "${terminfo[khome]}" != "" ]]; then
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
fi
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
fi
bindkey ' ' magic-space # [Space] - do history expansion
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards
fi
bindkey '^?' backward-delete-char # [Backspace] - delete backward
if [[ "${terminfo[kdch1]}" != "" ]]; then
bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
else
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
# Edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
# file rename magick
bindkey "^[m" copy-prev-shell-word
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
#
#bindkey '^[[A' up-line-or-search
#bindkey '^[[B' down-line-or-search
#bindkey '^[^[[C' emacs-forward-word
#bindkey '^[^[[D' emacs-backward-word
#
#bindkey -s '^X^Z' '%-^M'
#bindkey '^[e' expand-cmd-path
#bindkey '^[^I' reverse-menu-complete
#bindkey '^X^N' accept-and-infer-next-history
#bindkey '^W' kill-region
#bindkey '^I' complete-word
## Fix weird sequence that rxvt produces
#bindkey -s '^[[Z' '\t'
#

42
.oh-my-zsh/lib/misc.zsh Normal file
View File

@ -0,0 +1,42 @@
## Load smart urls if available
# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
autoload -Uz is-at-least
if [[ $ZSH_VERSION != 5.1.1 ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
fi
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
break
fi
done
fi
## jobs
setopt long_list_jobs
## pager
env_default PAGER 'less'
env_default LESS '-R'
## super user alias
alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
if which ack-grep &> /dev/null; then
alias afind='ack-grep -il'
else
alias afind='ack -il'
fi
# only define LC_CTYPE if undefined
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
fi
# recognize comments
setopt interactivecomments

9
.oh-my-zsh/lib/nvm.zsh Normal file
View File

@ -0,0 +1,9 @@
# get the node.js version
function nvm_prompt_info() {
[[ -f "$NVM_DIR/nvm.sh" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
nvm_prompt=${nvm_prompt:1}
echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
}

View File

@ -0,0 +1,33 @@
# *_prompt_info functions for usage in your prompt
#
# Plugin creators, please add your *_prompt_info function to the list
# of dummy implementations to help theme creators not receiving errors
# without the need of implementing conditional clauses.
#
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
# git_prompt_info, bzr_prompt_info and nvm_prompt_info
# Dummy implementations that return false to prevent command_not_found
# errors with themes, that implement these functions
# Real implementations will be used when the respective plugins are loaded
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
virtualenv_prompt_info {
return 1
}
# oh-my-zsh supports an rvm prompt by default
# get the name of the rvm ruby version
function rvm_prompt_info() {
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
[[ "${rvm_prompt}x" == "x" ]] && return 1
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}
# use this to enable users to see their ruby version, no matter which
# version management system they use
function ruby_prompt_info() {
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
}

View File

@ -0,0 +1,37 @@
#! /bin/zsh
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
FX=(
reset "%{%}"
bold "%{%}" no-bold "%{%}"
italic "%{%}" no-italic "%{%}"
underline "%{%}" no-underline "%{%}"
blink "%{%}" no-blink "%{%}"
reverse "%{%}" no-reverse "%{%}"
)
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
# Show all 256 colors with color number
function spectrum_ls() {
for code in {000..255}; do
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
for code in {000..255}; do
print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}

View File

@ -0,0 +1,105 @@
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
emulate -L zsh
setopt prompt_subst
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
: ${2=$1}
case "$TERM" in
cygwin|xterm*|putty*|rxvt*|ansi)
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
;;
screen*)
print -Pn "\ek$1:q\e\\" # set screen hardstatus
;;
*)
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
else
# Try to use terminfo to set the title
# If the feature is available set title
if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
echoti tsl
print -Pn "$1"
echoti fsl
fi
fi
;;
esac
}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt
function omz_termsupport_precmd {
emulate -L zsh
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
}
# Runs before executing the command
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
# cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'
}
precmd_functions+=(omz_termsupport_precmd)
preexec_functions+=(omz_termsupport_preexec)
# Keep Apple Terminal.app's current working directory updated
# Based on this answer: http://superuser.com/a/315029
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
# Emits the control sequence to notify Terminal.app of the cwd
# Identifies the directory using a file: URI scheme, including
# the host name to disambiguate local vs. remote paths.
function update_terminalapp_cwd() {
emulate -L zsh
# Percent-encode the pathname.
local URL_PATH="$(omz_urlencode -P $PWD)"
[[ $? != 0 ]] && return 1
# Undocumented Terminal.app-specific control sequence
printf '\e]7;%s\a' "file://$HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
precmd_functions+=(update_terminalapp_cwd)
# Run once to get initial cwd set
update_terminalapp_cwd
fi

View File

@ -0,0 +1,55 @@
# ls colors
autoload -U colors && colors
# Enable ls colors
export LSCOLORS="Gxfxcxdxbxegedabagacad"
# TODO organise this chaotic logic
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
if [[ "$OSTYPE" == netbsd* ]]; then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
elif [[ "$OSTYPE" == openbsd* ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null && alias ls='colorls -G'
elif [[ "$OSTYPE" == darwin* ]]; then
# this is a good alias, it works by default just using $LSCOLORS
ls -G . &>/dev/null && alias ls='ls -G'
# only use coreutils ls if there is a dircolors customization present ($LS_COLORS or .dircolors file)
# otherwise, gls will use the default color scheme which is ugly af
[[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] && gls --color -d . &>/dev/null && alias ls='gls --color=tty'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
if [[ -z "$LS_COLORS" ]]; then
(( $+commands[dircolors] )) && eval "$(dircolors -b)"
fi
ls --color -d . &>/dev/null && alias ls='ls --color=tty' || { ls -G . &>/dev/null && alias ls='ls -G' }
# Take advantage of $LS_COLORS for completion as well.
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
fi
fi
setopt auto_cd
setopt multios
setopt prompt_subst
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean

113
.oh-my-zsh/oh-my-zsh.sh Normal file
View File

@ -0,0 +1,113 @@
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
: ${ZSH_DISABLE_COMPFIX:=true}
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
[ -f "${custom_config_file}" ] && config_file=${custom_config_file}
source $config_file
done
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
fi
done
# Figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
# macOS's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
SHORT_HOST=${HOST/.*/}
fi
# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
# If completion insecurities exist, warn the user without enabling completions.
if ! compaudit &>/dev/null; then
# This function resides in the "lib/compfix.zsh" script sourced above.
handle_completion_insecurities
# Else, enable and cache completions to the desired file.
else
compinit -d "${ZSH_COMPDUMP}"
fi
else
compinit -i -d "${ZSH_COMPDUMP}"
fi
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi
done
# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
source $config_file
done
unset config_file
# Load the theme
if [ "$ZSH_THEME" = "random" ]; then
themes=($ZSH/themes/*zsh-theme)
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
if [ ! "$ZSH_THEME" = "" ]; then
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
fi
fi

View File

@ -0,0 +1,8 @@
# adb autocomplete plugin
* Adds autocomplete options for all adb commands.
## Requirements
In order to make this work, you will need to have the Android adb tools set up in your path.

View File

@ -0,0 +1,53 @@
#compdef adb
#autoload
# in order to make this work, you will need to have the android adb tools
# adb zsh completion, based on homebrew completion
local -a _1st_arguments
_1st_arguments=(
'bugreport:return all information from the device that should be included in a bug report.'
'connect:connect to a device via TCP/IP Port 5555 is default.'
'devices:list all connected devices'
'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
'emu:run emulator console command'
'forward:forward socket connections'
'get-devpath:print the device path'
'get-serialno:print the serial number of the device'
'get-state:print the current state of the device: offline | bootloader | device'
'help:show the help message'
'install:push this package file to the device and install it'
'jdwp:list PIDs of processes hosting a JDWP transport'
'keygen:generate adb public/private key'
'kill-server:kill the server if it is running'
'logcat:view device log'
'pull:copy file/dir from 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'
'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'
'usb:restart the adbd daemon listing on USB'
'version:show version num'
'wait-for-device:block until device is online'
)
local expl
local -a pkgs installed_pkgs
_arguments \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "adb subcommand" _1st_arguments
return
fi
_files

View File

@ -0,0 +1,16 @@
_ant_does_target_list_need_generating () {
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;
}
_ant () {
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
fi
compadd -- `cat .ant_targets`
fi
}
compdef _ant ant

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,6 @@
# commands to control local apache2 server installation
# paths are for osx installation via macports
alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'

View File

@ -0,0 +1,5 @@
## arcanist
**Maintainer:** [@emzar](https://github.com/emzar)
This plugin adds many useful aliases.

View File

@ -0,0 +1,21 @@
#
# Aliases
# (sorted alphabetically)
#
alias ara='arc amend'
alias arb='arc branch'
alias arco='arc cover'
alias arci='arc commit'
alias ard='arc diff'
alias ardnu='arc diff --nounit'
alias ardnupc='arc diff --nounit --plan-changes'
alias ardpc='arc diff --plan-changes'
alias are='arc export'
alias arh='arc help'
alias arl='arc land'
alias arli='arc lint'
alias arls='arc list'
alias arpa='arc patch'

View File

@ -0,0 +1,97 @@
# Archlinux plugin
## Features
#### YAOURT
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
| yaconf | yaourt -C | Fix all configuration files with vimdiff |
| yain | yaourt -S | Install packages from the repositories |
| yains | yaourt -U | Install a package from a local file |
| yainsd | yaourt -S --asdeps | Install packages as dependencies of another package |
| yaloc | yaourt -Qi | Display information about a package in the local database |
| yalocs | yaourt -Qs | Search for packages in the local database |
| yalst | yaourt -Qe | List installed packages including from AUR (tagged as "local") |
| yamir | yaourt -Syy | Force refresh of all package lists after updating mirrorlist |
| yaorph | yaourt -Qtd | Remove orphans using yaourt |
| yare | yaourt -R | Remove packages, keeping its settings and dependencies |
| yarem | yaourt -Rns | Remove packages, including its settings and unneeded dependencies |
| yarep | yaourt -Si | Display information about a package in the repositories |
| yareps | yaourt -Ss | Search for packages in the repositories |
| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases |
| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases |
| yaupd | yaourt -Sy | Update and refresh the local package database |
| yaupg | yaourt -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
| upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
### PACAUR
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
| pain | pacaur -S | Install packages from the repositories |
| pains | pacaur -U | Install a package from a local file |
| painsd | pacaur -S --asdeps | Install packages as dependencies of another package |
| paloc | pacaur -Qi | Display information about a package in the local database |
| palocs | pacaur -Qs | Search for packages in the local database |
| palst | pacaur -Qe | List installed packages including from AUR (tagged as "local") |
| pamir | pacaur -Syy | Force refresh of all package lists after updating mirrorlist |
| paorph | pacaur -Qtd | Remove orphans using pacaur |
| pare | pacaur -R | Remove packages, keeping its settings and dependencies |
| parem | pacaur -Rns | Remove packages, including its settings and unneeded dependencies |
| parep | pacaur -Si | Display information about a package in the repositories |
| pareps | pacaur -Ss | Search for packages in the repositories |
| paupd | pacaur -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
| paupd | pacaur -Sy && sudo abs | Update and refresh the local package and ABS databases |
| paupd | pacaur -Sy && sudo aur | Update and refresh the local package and AUR databases |
| paupd | pacaur -Sy | Update and refresh the local package database |
| paupg | pacaur -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| pasu | pacaur -Syua --no-confirm | Same as `paupg`, but without confirmation |
| upgrade | pacaur -Syu | Sync with repositories before upgrading packages |
#### PACMAN
| Alias | Command | Description |
|--------------|-----------------------------------------|--------------------------------------------------------------|
| pacin | sudo pacman -S | Install packages from the repositories |
| pacins | sudo pacman -U | Install a package from a local file |
| pacinsd | sudo pacman -S --asdeps | Install packages as dependencies of another package |
| pacloc | pacman -Qi | Display information about a package in the local database |
| paclocs | pacman -Qs | Search for packages in the local database |
| paclsorphans | sudo pacman -Qdt | List all orphaned packages |
| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating mirrorlist |
| pacre | sudo pacman -R | Remove packages, keeping its settings and dependencies |
| pacrem | sudo pacman -Rns | Remove packages, including its settings and dependencies |
| pacrep | pacman -Si | Display information about a package in the repositories |
| pacreps | pacman -Ss | Search for packages 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 |
| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases |
| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases |
| pacupd | sudo pacman -Sy | Update and refresh the local package database |
| pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
| upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
| pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
| pacfiles | pacman -Fs | Search package file names for matching strings. |
| Function | Description |
|----------------|------------------------------------------------------|
| pacdisowned | List all disowned files in your system |
| paclist | List all installed packages with a short description |
| pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | Locally trust all keys passed as parameters |
---
## 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
- Juraj Fiala - doctorjellyface@riseup.net
- Majora320 (Moses Miller) - Majora320@gmail.com

View File

@ -0,0 +1,138 @@
if (( $+commands[yaourt] )); then
alias yaconf='yaourt -C'
alias yaupg='yaourt -Syua'
alias yasu='yaourt -Syua --noconfirm'
alias yain='yaourt -S'
alias yains='yaourt -U'
alias yare='yaourt -R'
alias yarem='yaourt -Rns'
alias yarep='yaourt -Si'
alias yareps='yaourt -Ss'
alias yaloc='yaourt -Qi'
alias yalocs='yaourt -Qs'
alias yalst='yaourt -Qe'
alias yaorph='yaourt -Qtd'
alias yainsd='yaourt -S --asdeps'
alias yamir='yaourt -Syy'
if (( $+commands[abs] && $+commands[aur] )); then
alias yaupd='yaourt -Sy && sudo abs && sudo aur'
elif (( $+commands[abs] )); then
alias yaupd='yaourt -Sy && sudo abs'
elif (( $+commands[aur] )); then
alias yaupd='yaourt -Sy && sudo aur'
else
alias yaupd='yaourt -Sy'
fi
fi
if (( $+commands[pacaur] )); then
alias paupg='pacaur -Syua'
alias pasu='pacaur -Syua --noconfirm'
alias pain='pacaur -S'
alias pains='pacaur -U'
alias pare='pacaur -R'
alias parem='pacaur -Rns'
alias parep='pacaur -Si'
alias pareps='pacaur -Ss'
alias paloc='pacaur -Qi'
alias palocs='pacaur -Qs'
alias palst='pacaur -Qe'
alias paorph='pacaur -Qtd'
alias painsd='pacaur -S --asdeps'
alias pamir='pacaur -Syy'
if (( $+commands[abs] && $+commands[aur] )); then
alias paupd='pacaur -Sy && sudo abs && sudo aur'
elif (( $+commands[abs] )); then
alias paupd='pacaur -Sy && sudo abs'
elif (( $+commands[aur] )); then
alias paupd='pacaur -Sy && sudo aur'
else
alias paupd='pacaur -Sy'
fi
fi
if (( $+commands[pacaur] )); then
upgrade() {
pacaur -Syu
}
elif (( $+commands[yaourt] )); then
upgrade() {
yaourt -Syu
}
else
upgrade() {
sudo pacman -Syu
}
fi
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu'
alias pacin='sudo pacman -S'
alias pacins='sudo pacman -U'
alias pacre='sudo pacman -R'
alias pacrem='sudo pacman -Rns'
alias pacrep='pacman -Si'
alias pacreps='pacman -Ss'
alias pacloc='pacman -Qi'
alias paclocs='pacman -Qs'
alias pacinsd='sudo pacman -S --asdeps'
alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
alias pacfileupg='sudo pacman -Fy'
alias pacfiles='pacman tFs'
if (( $+commands[abs] && $+commands[aur] )); then
alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'
elif (( $+commands[abs] )); then
alias pacupd='sudo pacman -Sy && sudo abs'
elif (( $+commands[aur] )); then
alias pacupd='sudo pacman -Sy && sudo aur'
else
alias pacupd='sudo pacman -Sy'
fi
paclist() {
# Source: https://bbs.archlinux.org/viewtopic.php?id=93683
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}'
}
pacdisowned() {
emulate -L zsh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
db=$tmp/db
fs=$tmp/fs
mkdir "$tmp"
trap 'rm -rf "$tmp"' EXIT
pacman -Qlq | sort -u > "$db"
find /bin /etc /lib /sbin /usr ! -name lost+found \
\( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
comm -23 "$fs" "$db"
}
pacmanallkeys() {
emulate -L zsh
curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
xargs sudo pacman-key --recv-keys
}
pacmansignkeys() {
emulate -L zsh
for key in $*; do
sudo pacman-key --recv-keys $key
sudo pacman-key --lsign-key $key
printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
--no-permission-warning --command-fd 0 --edit-key $key
done
}

View File

@ -0,0 +1,27 @@
## asdf
**Maintainer:** [@RobLoach](https://github.com/RobLoach)
Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more.
### Installation
1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`.
```
plugins=(asdf)
```
2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following:
```
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
```
### Usage
See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf:
```
asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git
asdf install nodejs 5.9.1
```

View File

@ -0,0 +1,7 @@
# Find where asdf should be installed.
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
# Load asdf, if found.
if [ -f $ASDF_DIR/asdf.sh ]; then
. $ASDF_DIR/asdf.sh
fi

View File

@ -0,0 +1,43 @@
# Activates autoenv or reports its failure
() {
if ! type autoenv_init >/dev/null; then
for d (~/.autoenv ~/.local/bin /usr/local/opt/autoenv /usr/local/bin); do
if [[ -e $d/activate.sh ]]; then
autoenv_dir=$d
break
fi
done
if [[ -z $autoenv_dir ]]; then
cat <<END >&2
-------- AUTOENV ---------
Could not locate autoenv installation.
Please check if autoenv is correctly installed.
In the meantime the autoenv plugin is DISABLED.
--------------------------
END
return 1
fi
source $autoenv_dir/activate.sh
fi
}
[[ $? != 0 ]] && return $?
# The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one.
use_env() {
typeset venv
venv="$1"
if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then
if workon | grep -q "$venv"; then
workon "$venv"
else
echo -n "Create virtualenv $venv now? (Yn) "
read answer
if [[ "$answer" == "Y" ]]; then
mkvirtualenv "$venv"
fi
fi
fi
}

View File

@ -0,0 +1,21 @@
if [ $commands[autojump] ]; then # check if autojump is installed
if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
. $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation
. $HOME/.autojump/share/autojump/autojump.zsh
elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation
. $HOME/.nix-profile/etc/profile.d/autojump.zsh
elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
. /etc/profile.d/autojump.sh
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
. /usr/local/share/autojump/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew
. `brew --prefix`/etc/autojump.sh
fi
fi

View File

@ -0,0 +1,32 @@
#compdef autopep8
#
# this is zsh completion function file.
# generated by genzshcomp(ver: 0.5.1)
#
typeset -A opt_args
local context state line
_arguments -s -S \
"--help[show this help message and exit]:" \
"-h[show this help message and exit]:" \
"--version[show program's version number and exit]:" \
"--verbose[print verbose messages; multiple -v result in more verbose messages]" \
"-v[print verbose messages; multiple -v result in more verbose messages]" \
"--diff[print the diff for the fixed source]" \
"-d[print the diff for the fixed source]" \
"--in-place[make changes to files in place]" \
"-i[make changes to files in place]" \
"--recursive[run recursively; must be used with --in-place or --diff]" \
"-r[run recursively; must be used with --in-place or --diff]" \
"--jobs[number of parallel jobs; match CPU count if value is less than 1]::n number of parallel jobs; match CPU count if value is:_files" \
"-j[number of parallel jobs; match CPU count if value is less than 1]::n number of parallel jobs; match CPU count if value is:_files" \
"--pep8-passes[maximum number of additional pep8 passes (default: 100)]::n:_files" \
"-p[maximum number of additional pep8 passes (default: 100)]::n:_files" \
"-a[-a result in more aggressive changes]::result:_files" \
"--exclude[exclude files/directories that match these comma- separated globs]::globs:_files" \
"--list-fixes[list codes for fixes; used by --ignore and --select]" \
"--ignore[do not fix these errors/warnings (default E226,E24)]::errors:_files" \
"--select[fix only these errors/warnings (e.g. E4,W)]::errors:_files" \
"--max-line-length[set maximum allowed line length (default: 79)]::n:_files" \
"*::args:_files"

View File

@ -0,0 +1,37 @@
_homebrew-installed() {
type brew &> /dev/null
}
_awscli-homebrew-installed() {
brew list awscli &> /dev/null
}
export AWS_HOME=~/.aws
function agp {
echo $AWS_DEFAULT_PROFILE
}
function asp {
local rprompt=${RPROMPT/<aws:$(agp)>/}
export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
}
function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
}
compctl -K aws_profiles asp
if _homebrew-installed && _awscli-homebrew-installed ; then
_aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh
else
_aws_zsh_completer_path=$(which aws_zsh_completer.sh)
fi
[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
unset _aws_zsh_completer_path

View File

@ -0,0 +1,160 @@
###########################################
# Battery plugin for oh-my-zsh #
# Original Author: Peter hoeg (peterhoeg) #
# Email: peter@speartail.com #
###########################################
# Author: Sean Jones (neuralsandwich) #
# Email: neuralsandwich@gmail.com #
# Modified to add support for Apple Mac #
###########################################
if [[ "$OSTYPE" = darwin* ]] ; then
function battery_pct() {
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
integer i=$(((currentcapacity/maxcapacity) * 100))
echo $i
}
function plugged_in() {
[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
}
function battery_pct_remaining() {
if plugged_in ; then
echo "External Power"
else
battery_pct
fi
}
function battery_time_remaining() {
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
if [ $timeremaining -gt 720 ] ; then
echo "::"
else
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
fi
else
echo "∞"
fi
}
function battery_pct_prompt () {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
b=$(battery_pct_remaining)
if [ $b -gt 50 ] ; then
color='green'
elif [ $b -gt 20 ] ; then
color='yellow'
else
color='red'
fi
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
else
echo "∞"
fi
}
function battery_is_charging() {
[[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
}
elif [[ "$OSTYPE" = linux* ]] ; then
function battery_is_charging() {
! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
}
function battery_pct() {
if (( $+commands[acpi] )) ; then
echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"
fi
}
function battery_pct_remaining() {
if [ ! $(battery_is_charging) ] ; then
battery_pct
else
echo "External Power"
fi
}
function battery_time_remaining() {
if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
echo $(acpi 2>/dev/null | cut -f3 -d ',')
fi
}
function battery_pct_prompt() {
b=$(battery_pct_remaining)
if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
if [ $b -gt 50 ] ; then
color='green'
elif [ $b -gt 20 ] ; then
color='yellow'
else
color='red'
fi
echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
else
echo "∞"
fi
}
else
# Empty functions so we don't cause errors in prompts
function battery_pct_remaining() {
}
function battery_time_remaining() {
}
function battery_pct_prompt() {
}
fi
function battery_level_gauge() {
local gauge_slots=${BATTERY_GAUGE_SLOTS:-10};
local green_threshold=${BATTERY_GREEN_THRESHOLD:-6};
local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-4};
local color_green=${BATTERY_COLOR_GREEN:-%F{green}};
local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}};
local color_red=${BATTERY_COLOR_RED:-%F{red}};
local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}};
local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['};
local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'};
local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'};
local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'};
local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow};
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'};
local battery_remaining_percentage=$(battery_pct);
if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then
local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots)));
local empty=$(($gauge_slots - $filled));
if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green;
elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow;
else local gauge_color=$color_red;
fi
else
local filled=$gauge_slots;
local empty=0;
filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
fi
local charging=' ' && battery_is_charging && charging=$charging_symbol;
printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
[[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty}
printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%}
}

View File

@ -0,0 +1,20 @@
## bbedit
Plugin for BBEdit, an HTML and text editor for Mac OS X
### Requirements
* [BBEdit](http://www.barebones.com/products/bbedit/)
* [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
### Usage
* If the `bb` command is called without an argument, launch BBEdit
* If `bb` is passed a directory, cd to it and open it in BBEdit
* If `bb` is passed a file, open it in BBEdit
* If `bbpb` create a new BBEdit document with the contents of the clipboard
* If `bbd` alias for BBEdit diff tool

View File

@ -0,0 +1,21 @@
alias bbpb='pbpaste | bbedit --clean --view-top'
alias bbd=bbdiff
#
# If the bb command is called without an argument, launch BBEdit
# If bb is passed a directory, cd to it and open it in BBEdit
# If bb is passed a file, open it in BBEdit
#
function bb() {
if [[ -z "$1" ]]
then
bbedit --launch
else
bbedit "$1"
if [[ -d "$1" ]]
then
cd "$1"
fi
fi
}

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,77 @@
#!/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 ## allow custom function override
function bgnotify_formatted { ## args: (exit_status, command, elapsed_seconds)
elapsed="$(( $3 % 60 ))s"
(( $3 >= 60 )) && elapsed="$((( $3 % 3600) / 60 ))m $elapsed"
(( $3 >= 3600 )) && elapsed="$(( $3 / 3600 ))h $elapsed"
[ $1 -eq 0 ] && bgnotify "#win (took $elapsed)" "$2" || bgnotify "#fail (took $elapsed)" "$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 || hash kdialog 2>/dev/null); then #ubuntu!
xprop -root 2> /dev/null | awk '/NET_ACTIVE_WINDOW/{print $5;exit} END{exit !$5}' || echo "0"
else
echo $EPOCHSECONDS #fallback for windows
fi
}
bgnotify () { ## args: (title, subtitle)
if hash terminal-notifier 2>/dev/null; then #osx
[[ "$TERM_PROGRAM" == 'iTerm.app' ]] && term_id='com.googlecode.iterm2';
[[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] && term_id='com.apple.terminal';
## now call terminal-notifier, (hopefully with $term_id!)
[ -z "$term_id" ] && terminal-notifier -message "$2" -title "$1" >/dev/null ||
terminal-notifier -message "$2" -title "$1" -activate "$term_id" -sender "$term_id" >/dev/null
elif hash growlnotify 2>/dev/null; then #osx growl
growlnotify -m "$1" "$2"
elif hash notify-send 2>/dev/null; then #ubuntu gnome!
notify-send "$1" "$2"
elif hash kdialog 2>/dev/null; then #ubuntu kde!
kdialog -title "$1" --passivepopup "$2" 5
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!
}
## only enable if a local (non-ssh) connection
if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
add-zsh-hook preexec bgnotify_begin
add-zsh-hook precmd bgnotify_end
fi

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

@ -0,0 +1,58 @@
# Credits to npm's awesome completion utility.
#
# Bower completion script, based on npm completion script.
###-begin-bower-completion-###
#
# Installation: bower completion >> ~/.bashrc (or ~/.zshrc)
# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/bower
#
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
export COMP_WORDBREAKS
if type complete &>/dev/null; then
_bower_completion () {
local si="$IFS"
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
COMP_LINE="$COMP_LINE" \
COMP_POINT="$COMP_POINT" \
bower completion -- "${COMP_WORDS[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
complete -F _bower_completion bower
elif type compdef &>/dev/null; then
_bower_completion() {
si=$IFS
compadd -- $(COMP_CWORD=$((CURRENT-1)) \
COMP_LINE=$BUFFER \
COMP_POINT=0 \
bower completion -- "${words[@]}" \
2>/dev/null)
IFS=$si
}
compdef _bower_completion bower
elif type compctl &>/dev/null; then
_bower_completion () {
local cword line point words si
read -Ac words
read -cn cword
let cword-=1
read -l line
read -ln point
si="$IFS"
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
COMP_LINE="$line" \
COMP_POINT="$point" \
bower completion -- "${words[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
compctl -K _bower_completion bower
fi
###-end-bower-completion-###

View File

@ -0,0 +1,82 @@
alias bi="bower install"
alias bl="bower list"
alias bs="bower search"
_bower_installed_packages () {
bower_package_list=$(bower ls --no-color 2>/dev/null| awk 'NR>3{print p}{p=$0}'| cut -d ' ' -f 2|sed 's/#.*//')
}
_bower ()
{
local -a _1st_arguments _no_color _dopts _save_dev _force_lastest _production
local expl
typeset -A opt_args
_no_color=('--no-color[Do not print colors (available in all commands)]')
_dopts=(
'(--save)--save[Save installed packages into the project"s bower.json dependencies]'
'(--force)--force[Force fetching remote resources even if a local copy exists on disk]'
)
_save_dev=('(--save-dev)--save-dev[Save installed packages into the project"s bower.json devDependencies]')
_force_lastest=('(--force-latest)--force-latest[Force latest version on conflict]')
_production=('(--production)--production[Do not install project devDependencies]')
_1st_arguments=(
'cache-clean:Clean the Bower cache, or the specified package caches' \
'help:Display help information about Bower' \
'info:Version info and description of a particular package' \
'init:Interactively create a bower.json file' \
'install:Install a package locally' \
'link:Symlink a package folder' \
'lookup:Look up a package URL by name' \
'register:Register a package' \
'search:Search for a package by name' \
'uninstall:Remove a package' \
'update:Update a package' \
{ls,list}:'[List all installed packages]'
)
_arguments \
$_no_color \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "bower subcommand" _1st_arguments
return
fi
case "$words[1]" in
install)
_arguments \
$_dopts \
$_save_dev \
$_force_lastest \
$_no_color \
$_production
;;
update)
_arguments \
$_dopts \
$_no_color \
$_force_lastest
_bower_installed_packages
compadd "$@" $(echo $bower_package_list)
;;
uninstall)
_arguments \
$_no_color \
$_dopts
_bower_installed_packages
compadd "$@" $(echo $bower_package_list)
;;
*)
_arguments \
$_no_color \
;;
esac
}
compdef _bower bower

View File

@ -0,0 +1,33 @@
# Branch
Displays the current Git or Mercurial branch fast.
## Speed test
### Mercurial
```shell
$ time hg branch
0.11s user 0.14s system 70% cpu 0.355 total
```
### Branch plugin
```shell
$ time zsh /tmp/branch_prompt_info_test.zsh
0.00s user 0.01s system 78% cpu 0.014 total
```
## Usage
Edit your theme file (eg.: `~/.oh-my-zsh/theme/robbyrussell.zsh-theme`)
adding `$(branch_prompt_info)` in your prompt like this:
```diff
- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(branch_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
```
## Maintainer
Victor Torres (<vpaivatorres@gmail.com>)

View File

@ -0,0 +1,31 @@
# Branch: displays the current Git or Mercurial branch fast.
# Victor Torres <vpaivatorres@gmail.com>
# Oct 2, 2015
function branch_prompt_info() {
# Defines path as current directory
local current_dir=$PWD
# While current path is not root path
while [[ $current_dir != '/' ]]
do
# Git repository
if [[ -d "${current_dir}/.git" ]]
then
echo '±' ${"$(<"$current_dir/.git/HEAD")"##*/}
return;
fi
# Mercurial repository
if [[ -d "${current_dir}/.hg" ]]
then
if [[ -f "$current_dir/.hg/branch" ]]
then
echo '☿' $(<"$current_dir/.hg/branch")
else
echo '☿ default'
fi
return;
fi
# Defines path as parent directory and keeps looking for :)
current_dir="${current_dir:h}"
done
}

View File

@ -0,0 +1,20 @@
alias brews='brew list -1'
alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'
if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
print -P '%F{yellow}'Oh My Zsh brew plugin:
cat <<-'EOF'
With the advent of their 1.0 release, Homebrew has decided to bundle
the zsh completion as part of the brew installation, so we no longer
ship it with the brew plugin; now it only has brew aliases.
If you find that brew completion no longer works, make sure you have
your Homebrew installation fully up to date.
You will only see this message once.
EOF
print -P '%f'
fi

View File

@ -0,0 +1,50 @@
# Bundler
- adds completion for basic bundler commands
- adds short aliases for common bundler commands
- `be` aliased to `bundle exec`
- `bl` aliased to `bundle list`
- `bp` aliased to `bundle package`
- `bo` aliased to `bundle open`
- `bout` aliased to `bundle outdated`
- `bu` aliased to `bundle update`
- `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
- adds a wrapper for common gems:
- looks for a binstub under `./bin/` and executes it (if present)
- calls `bundle exec <gem executable>` otherwise
For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
## Configuration
Please use the exact name of the executable and not the gem name.
### Add additional gems to be wrapped
Add this before the plugin-list in your `.zshrc`:
```sh
BUNDLED_COMMANDS=(rubocop)
plugins=(... bundler ...)
```
This will add the wrapper for the `rubocop` gem (i.e. the executable).
### Exclude gems from being wrapped
Add this before the plugin-list in your `.zshrc`:
```sh
UNBUNDLED_COMMANDS=(foreman spin)
plugins=(... bundler ...)
```
This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
## Excluded gems
These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification.
`berks`
`foreman`
`mailcatcher`
`rails`
`ruby`
`spin`

View File

@ -0,0 +1,104 @@
#compdef bundle
local curcontext="$curcontext" state line _gems _opts ret=1
_arguments -C -A "-v" -A "--version" \
'(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "bundle command" \
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
"update[Update dependencies to their latest versions]" \
"package[Package the .gem files required by your application]" \
"exec[Execute a script in the context of the current bundle]" \
"config[Specify and read configuration options for bundler]" \
"check[Determine whether the requirements for your application are installed]" \
"list[Show all of the gems in the current bundle]" \
"show[Show the source location of a particular gem in the bundle]" \
"outdated[Show all of the outdated gems in the current bundle]" \
"console[Start an IRB session in the context of the current bundle]" \
"open[Open an installed gem in the editor]" \
"viz[Generate a visual representation of your dependencies]" \
"init[Generate a simple Gemfile, placed in the current directory]" \
"gem[Create a simple gem, suitable for development with bundler]" \
"platform[Displays platform compatibility information]" \
"clean[Cleans up unused gems in your bundler directory]" \
"help[Describe available tasks or one specific task]"
ret=0
;;
args)
case $line[1] in
help)
_values 'commands' \
'install' \
'update' \
'package' \
'exec' \
'config' \
'check' \
'list' \
'show' \
'outdated' \
'console' \
'open' \
'viz' \
'init' \
'gem' \
'platform' \
'help' && ret=0
;;
install)
_arguments \
'(--no-color)--no-color[disable colorization in output]' \
'(--local)--local[do not attempt to connect to rubygems.org]' \
'(--quiet)--quiet[only output warnings and errors]' \
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
'(--system)--system[install to the system location]' \
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
'(--path)--path=-[specify a different path than the system default]:path:_files' \
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
ret=0
;;
exec)
_normal && ret=0
;;
clean)
_arguments \
'(--force)--force[forces clean even if --path is not set]' \
'(--dry-run)--dry-run[only print out changes, do not actually clean gems]' \
'(--no-color)--no-color[Disable colorization in output]' \
'(--verbose)--verbose[Enable verbose output mode]'
ret=0
;;
outdated)
_arguments \
'(--pre)--pre[Check for newer pre-release gems]' \
'(--source)--source[Check against a specific source]' \
'(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \
'(--no-color)--no-color[Disable colorization in output]' \
'(--verbose)--verbose[Enable verbose output mode]'
ret=0
;;
(open|show)
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
if [[ $_gems != "" ]]; then
_values 'gems' $_gems && ret=0
fi
;;
*)
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0
fi
;;
esac
;;
esac
return ret

View File

@ -0,0 +1,112 @@
alias be="bundle exec"
alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
alias bout="bundle outdated"
alias bu="bundle update"
alias bi="bundle_install"
alias bcn="bundle clean"
bundled_commands=(
annotate
cap
capify
cucumber
foodcritic
guard
irb
jekyll
kitchen
knife
middleman
nanoc
pry
puma
rackup
rainbows
rake
rspec
shotgun
sidekiq
spec
spork
spring
strainer
tailor
taps
thin
thor
unicorn
unicorn_rails
)
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do
bundled_commands=(${bundled_commands#$cmd});
done
# Add $BUNDLED_COMMANDS to the bundled_commands list
for cmd in $BUNDLED_COMMANDS; do
bundled_commands+=($cmd);
done
## Functions
bundle_install() {
if _bundler-installed && _within-bundled-project; then
local bundler_version=`bundle version | cut -d' ' -f3`
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
if [[ "$OSTYPE" = darwin* ]]
then
local cores_num="$(sysctl -n hw.ncpu)"
else
local cores_num="$(nproc)"
fi
bundle install --jobs=$cores_num $@
else
bundle install $@
fi
else
echo "Can't 'bundle install' outside a bundled project"
fi
}
_bundler-installed() {
which bundle > /dev/null 2>&1
}
_within-bundled-project() {
local check_dir="$PWD"
while [ "$check_dir" != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)"
done
false
}
_binstubbed() {
[ -f "./bin/${1}" ]
}
_run-with-bundler() {
if _bundler-installed && _within-bundled-project; then
if _binstubbed $1; then
./bin/$@
else
bundle exec $@
fi
else
$@
fi
}
## Main program
for cmd in $bundled_commands; do
eval "function unbundled_$cmd () { $cmd \$@ }"
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
alias $cmd=bundled_$cmd
if which _$cmd > /dev/null 2>&1; then
compdef _$cmd bundled_$cmd=$cmd
fi
done

View File

@ -0,0 +1,13 @@
#
# Requires http://www.bruji.com/bwana/
#
if [[ -e /Applications/Bwana.app ]] ||
( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
then
function man() {
open "man:$1"
}
else
echo "Bwana lets you read man files in Safari through a man: URI scheme"
echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
fi

View File

@ -0,0 +1,93 @@
function cabal_sandbox_info() {
cabal_files=(*.cabal(N))
if [ $#cabal_files -gt 0 ]; then
if [ -f cabal.sandbox.config ]; then
echo "%{$fg[green]%}sandboxed%{$reset_color%}"
else
echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
fi
fi
}
function _cabal_commands() {
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
"bench:Run the benchmark, if any (configure with UserHooks)"
"build:Compile all targets or specific target."
"check:Check the package for common mistakes"
"clean:Clean up after a build"
"copy:Copy the files into the install locations"
"configure:Prepare to build the package"
"exec:Run a command with the cabal environment"
"fetch:Downloads packages for later installation"
"freeze:Freeze dependencies."
"get:Gets a package's source code"
"haddock:Generate Haddock HTML documentation"
"help:Help about commands"
"hscolour:Generate HsColour colourised code, in HTML format"
"info:Display detailed information about a particular package"
"init:Interactively create a .cabal file"
"install:Installs a list of packages"
"list:List packages matching a search string"
"register:Register this package with the compiler"
"repl:Open an interpreter session for the given target"
"report:Upload build reports to a remote server"
"run:Runs the compiled executable"
"sandbox:Create/modify/delete a sandbox"
"sdist:Generate a source distribution file (.tar.gz)"
"test:Run the test suite, if any (configure with UserHooks)"
"unpack:Unpacks packages for user inspection"
"update:Updates list of known packages"
"upload:Uploads source packages to Hackage"
)
_describe -t subcommands 'cabal subcommands' subcommands && ret=0
esac
return ret
}
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,33 @@
# Set this to 1 if you want to cache the tasks
_cake_cache_task_list=1
# Cache filename
_cake_task_cache_file='.cake_task_cache'
_cake_get_target_list () {
cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'
}
_cake_does_target_list_need_generating () {
if [ ${_cake_cache_task_list} -eq 0 ]; then
return 1;
fi
[ ! -f ${_cake_task_cache_file} ] && return 0;
[ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
return 1;
}
_cake () {
if [ -f Cakefile ]; then
if _cake_does_target_list_need_generating; then
_cake_get_target_list > ${_cake_task_cache_file}
compadd `cat ${_cake_task_cache_file}`
else
compadd `_cake_get_target_list`
fi
fi
}
compdef _cake cake

View File

@ -0,0 +1,38 @@
# CakePHP 3 basic command completion
_cakephp3_get_command_list () {
bin/cake Completion commands
}
_cakephp3_get_sub_command_list () {
bin/cake Completion subcommands ${words[2]}
}
_cakephp3_get_3rd_argument () {
bin/cake ${words[2]} ${words[3]} | \grep '\-\ '| \awk '{print $2}'
}
_cakephp3 () {
local -a has3rdargument
has3rdargument=("all" "controller" "fixture" "model" "template")
if [ -f bin/cake ]; then
if (( CURRENT == 2 )); then
compadd $(_cakephp3_get_command_list)
fi
if (( CURRENT == 3 )); then
compadd $(_cakephp3_get_sub_command_list)
fi
if (( CURRENT == 4 )); then
if [[ ${has3rdargument[(i)${words[3]}]} -le ${#has3rdargument} ]]; then
compadd $(_cakephp3_get_3rd_argument)
fi
fi
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,49 @@
#compdef capit
#autoload
# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
local curcontext="$curcontext" state line ret=1
local -a _configs
_arguments -C \
'1: :->cmds' \
'2:: :->args' && ret=0
_cap_tasks() {
if [[ -f config/deploy.rb || -f Capfile ]]; then
if [[ ! -f .cap_tasks~ ]]; then
capit --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
fi
OLD_IFS=$IFS
IFS=$'\n'
_values 'cap commands' $(< .cap_tasks~)
IFS=$OLD_IFS
# zmodload zsh/mapfile
# _values ${(f)mapfile[.cap_tasks~]}
fi
}
_cap_stages() {
compadd $(find config/deploy -name \*.rb | cut -d/ -f3 | sed s:.rb::g)
}
case $state in
cmds)
# check if it uses multistage
if [[ -d config/deploy ]]; then
_cap_stages
else
_cap_tasks
fi
ret=0
;;
args)
_cap_tasks
ret=0
;;
esac
return ret

View File

@ -0,0 +1,11 @@
# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
func capit() {
if [ -f Gemfile ]
then
bundle exec cap $*
else
cap $*
fi
}

View File

@ -0,0 +1,11 @@
# cargo
This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo).
To use it, add `cargo` to the plugins array in your zshrc file:
```zsh
plugins=(... cargo)
```
Updated on October 4th, 2016.

View File

@ -0,0 +1,497 @@
#compdef cargo
typeset -A opt_args
autoload -U regexp-replace
_cargo() {
_arguments \
'(- 1 *)'{-h,--help}'[show help message]' \
'(- 1 *)'--list'[list installed commands]' \
'(- 1 *)'{-v,--verbose}'[use verbose output]' \
'(- 1 *)'--color'[colorization option]' \
'(- 1 *)'{-V,--version}'[show version information]' \
'1: :_cargo_cmds' \
'*:: :->args'
case $state in
args)
case $words[1] in
bench)
_arguments \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
"${command_scope_spec[@]}" \
'--manifest-path=[path to manifest]: :_files -/' \
'--no-default-features[do not build the default features]' \
'--no-run[compile but do not run]' \
'(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \
'--target=[target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--color=:colorization option:(auto always never)' \
;;
build)
_arguments \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
"${command_scope_spec[@]}" \
'--manifest-path=[path to manifest]: :_files -/' \
'--no-default-features[do not build the default features]' \
'(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \
'--release=[build in release mode]' \
'--target=[target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--color=:colorization option:(auto always never)' \
;;
clean)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release[whether or not to clean release artifacts]' \
'--target=[target triple(default:all)]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
doc)
_arguments \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--no-deps[do not build docs for dependencies]' \
'--no-default-features[do not build the default features]' \
'--open[open docs in browser after the build]' \
'(-p, --package)'{-p,--package}'=[package to document]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release[build artifacts in release mode, with optimizations]' \
'--target=[build for the target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
fetch)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
generate-lockfile)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
git-checkout)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'q(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--reference=[REF]' \
'--url=[URL]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
help)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'*: :_cargo_cmds' \
;;
init)
_arguments \
'--bin[use binary template]' \
'--vcs:initialize a new repo with a given VCS:(git hg none)' \
'(-h, --help)'{-h,--help}'[show help message]' \
'--name=[set the resulting package name]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
install)
_arguments \
'--bin=[only install the specified binary]' \
'--branch=[branch to use when installing from git]' \
'--color=:colorization option:(auto always never)' \
'--debug[build in debug mode instead of release mode]' \
'--example[install the specified example instead of binaries]' \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'--git=[URL from which to install the crate]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
'--no-default-features[do not build the default features]' \
'--path=[local filesystem path to crate to install]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--rev=[specific commit to use when installing from git]' \
'--root=[directory to install packages into]' \
'--tag=[tag to use when installing from git]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--vers=[version to install from crates.io]' \
;;
locate-project)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
;;
login)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--host=[Host to set the token for]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
metadata)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
"--no-deps[output information only about the root package and don't fetch dependencies]" \
'--no-default-features[do not include the default feature]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'--format-version=[format version(default: 1)]' \
'--color=:colorization option:(auto always never)' \
;;
new)
_arguments \
'--bin[use binary template]' \
'--vcs:initialize a new repo with a given VCS:(git hg none)' \
'(-h, --help)'{-h,--help}'[show help message]' \
'--name=[set the resulting package name]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
owner)
_arguments \
'(-a, --add)'{-a,--add}'[add owner LOGIN]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'--index[registry index]' \
'(-l, --list)'{-l,--list}'[list owners of a crate]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \
'--token[API token to use when authenticating]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
package)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-l, --list)'{-l,--list}'[print files included in a package without making one]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--no-metadata[ignore warnings about a lack of human-usable metadata]' \
'--no-verify[do not build to verify contents]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
pkgid)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
publish)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--host=[Host to set the token for]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--no-verify[Do not verify tarball until before publish]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--token[token to use when uploading]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
read-manifest)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
run)
_arguments \
'--example=[name of the bin target]' \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--bin=[name of the bin target]' \
'--no-default-features[do not build the default features]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release=[build in release mode]' \
'--target=[target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
'*: :_normal' \
;;
rustc)
_arguments \
'--color=:colorization option:(auto always never)' \
'--features=[features to compile for the package]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
'--manifest-path=[path to the manifest to fetch dependencies for]' \
'--no-default-features[do not compile default features for the package]' \
'(-p, --package)'{-p,--package}'=[profile to compile for]' \
'--profile=[profile to build the selected target for]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release[build artifacts in release mode, with optimizations]' \
'--target=[target triple which compiles will be for]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
"${command_scope_spec[@]}" \
;;
rustdoc)
_arguments \
'--color=:colorization option:(auto always never)' \
'--features=[space-separated list of features to also build]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
'--manifest-path=[path to the manifest to document]' \
'--no-default-features[do not build the `default` feature]' \
'--open[open the docs in a browser after the operation]' \
'(-p, --package)'{-p,--package}'=[package to document]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release[build artifacts in release mode, with optimizations]' \
'--target=[build for the target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
"${command_scope_spec[@]}" \
;;
search)
_arguments \
'--color=:colorization option:(auto always never)' \
'(-h, --help)'{-h,--help}'[show help message]' \
'--host=[host of a registry to search in]' \
'--limit=[limit the number of results]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
;;
test)
_arguments \
'--features=[space separated feature list]' \
'--all-features[enable all available features]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
'--manifest-path=[path to manifest]: :_files -/' \
'--test=[test name]: :_test_names' \
'--no-default-features[do not build the default features]' \
'--no-fail-fast[run all tests regardless of failure]' \
'--no-run[compile but do not run]' \
'(-p,--package)'{-p=,--package=}'[package to run tests for]:packages:_get_package_names' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--release[build artifacts in release mode, with optimizations]' \
'--target=[target triple]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
'1: :_test_names' \
;;
uninstall)
_arguments \
'--bin=[only uninstall the binary NAME]' \
'--color=:colorization option:(auto always never)' \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \
'--root=[directory to uninstall packages from]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
;;
update)
_arguments \
'--aggressive=[force dependency update]' \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \
'--precise=[update single dependency to PRECISE]: :' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
verify-project)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--manifest-path=[path to manifest]: :_files -/' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
version)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
;;
yank)
_arguments \
'(-h, --help)'{-h,--help}'[show help message]' \
'--index[registry index]' \
'(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
'--token[API token to use when authenticating]' \
'--undo[undo a yank, putting a version back into the index]' \
'(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
'--color=:colorization option:(auto always never)' \
'--vers[yank version]' \
;;
esac
;;
esac
}
_cargo_cmds(){
local -a commands;commands=(
'bench:execute all benchmarks of a local package'
'build:compile the current project'
'clean:remove generated artifacts'
'doc:build package documentation'
'fetch:fetch package dependencies'
'generate-lockfile:create lockfile'
'git-checkout:git checkout'
'help:get help for commands'
'init:create new project in current directory'
'install:install a Rust binary'
'locate-project:print "Cargo.toml" location'
'login:login to remote server'
'metadata:the metadata for a project in json'
'new:create a new project'
'owner:manage the owners of a crate on the registry'
'package:assemble local package into a distributable tarball'
'pkgid:print a fully qualified package specification'
'publish:upload package to the registry'
'read-manifest:print manifest in JSON format'
'run:run the main binary of the local package'
'rustc:compile a package and all of its dependencies'
'rustdoc:build documentation for a package'
'search:search packages on crates.io'
'test:execute all unit and tests of a local package'
'uninstall:remove a Rust binary'
'update:update dependencies'
'verify-project:check Cargo.toml'
'version:show version information'
'yank:remove pushed file from index'
)
_describe 'command' commands
}
#FIXME: Disabled until fixed
#gets package names from the manifest file
_get_package_names()
{
}
#TODO:see if it makes sense to have 'locate-project' to have non-json output.
#strips package name from json stuff
_locate_manifest(){
local manifest=`cargo locate-project 2>/dev/null`
regexp-replace manifest '\{"root":"|"\}' ''
echo $manifest
}
# Extracts the values of "name" from the array given in $1 and shows them as
# command line options for completion
_get_names_from_array()
{
local -a filelist;
local manifest=$(_locate_manifest)
if [[ -z $manifest ]]; then
return 0
fi
local last_line
local -a names;
local in_block=false
local block_name=$1
names=()
while read line
do
if [[ $last_line == "[[$block_name]]" ]]; then
in_block=true
else
if [[ $last_line =~ '.*\[\[.*' ]]; then
in_block=false
fi
fi
if [[ $in_block == true ]]; then
if [[ $line =~ '.*name.*=' ]]; then
regexp-replace line '^.*name *= *|"' ""
names+=$line
fi
fi
last_line=$line
done < $manifest
_describe $block_name names
}
#Gets the test names from the manifest file
_test_names()
{
_get_names_from_array "test"
}
#Gets the bench names from the manifest file
_benchmark_names()
{
_get_names_from_array "bench"
}
# These flags are mutally exclusive specifiers for the scope of a command; as
# they are used in multiple places without change, they are expanded into the
# appropriate command's `_arguments` where appropriate.
set command_scope_spec
command_scope_spec=(
'(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names'
'(--bench --bin --test --lib)--example=[example name]'
'(--bench --example --test --lib)--bin=[binary name]'
'(--bench --bin --example --test)--lib=[library name]'
'(--bench --bin --example --lib)--test=[test name]'
)
_cargo

View File

@ -0,0 +1,15 @@
# Cask plugin
[Cask](https://github.com/cask/cask) is a project management tool for Emacs that helps
automate the package development cycle; development, dependencies, testing, building,
packaging and more.
This plugin loads `cask` completion from non-standard locations, such as if installed
via Homebrew or others. To enable it, add `cask` to your plugins array:
```zsh
plugins=(... cask)
```
Make sure you have the `cask` directory in your `$PATH` before loading Oh My Zsh,
otherwise you'll get a "command not found" error.

View File

@ -0,0 +1,26 @@
() {
emulate -L zsh
if ! (( $+commands[cask] )); then
print "zsh cask plugin: cask command not found" >&2
return
fi
cask_base=${commands[cask]:h:h}
# Plain cask installation location (for Cask 0.7.2 and earlier)
comp_files=($cask_base/etc/cask_completion.zsh)
# Mac Homebrew installs the completion in a different location
if (( $+commands[brew] )); then
comp_files+=($(brew --prefix)/share/zsh/site-functions/cask_completion.zsh)
fi
# Load first found file
for f in $comp_files; do
if [[ -f "$f" ]]; then
source "$f"
break
fi
done
}

View File

@ -0,0 +1,17 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# http://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #
# Github: https://github.com/posva/catimg #
################################################################################
function catimg() {
if [[ -x `which convert` ]]; then
zsh $ZSH/plugins/catimg/catimg.sh $@
else
echo "catimg need convert (ImageMagick) to work)"
fi
}

View File

@ -0,0 +1,88 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# http://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #
# Github: https://github.com/posva/catimg #
################################################################################
function help() {
echo "Usage catimg [-h] [-w width] [-c char] img"
echo "By default char is \" \" and w is the terminal width"
}
# VARIABLES
COLOR_FILE=$(dirname $0)/colors.png
CHAR=" "
WIDTH=""
IMG=""
while getopts qw:c:h opt; do
case "$opt" in
w) WIDTH="$OPTARG" ;;
c) CHAR="$OPTARG" ;;
h) help; exit ;;
*) help ; exit 1;;
esac
done
while [ "$1" ]; do
IMG="$1"
shift
done
if [ "$IMG" = "" -o ! -f "$IMG" ]; then
help
exit 1
fi
if [ ! "$WIDTH" ]; then
COLS=$(expr $(tput cols) "/" $(echo -n "$CHAR" | wc -c))
else
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
fi
WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
if [ "$WIDTH" -gt "$COLS" ]; then
WIDTH=$COLS
fi
REMAP=""
if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
REMAP="-remap $COLOR_FILE"
else
echo "The version of convert is too old, don't expect good results :(" >&2
#convert "$IMG" -colors 256 PNG8:tmp.png
#IMG="tmp.png"
fi
# Display the image
I=0
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
while read R G B f; do
if [ ! "$R" = "NO" ]; then
if [ "$R" -eq "$G" -a "$G" -eq "$B" ]; then
((
I++,
IDX = 232 + R * 23 / 255
))
else
((
I++,
IDX = 16
+ R * 5 / 255 * 36
+ G * 5 / 255 * 6
+ B * 5 / 255
))
fi
#echo "$R,$G,$B: $IDX"
echo -ne "\e[48;5;${IDX}m${CHAR}"
else
(( I++ ))
echo -ne "\e[0m${CHAR}"
fi
# New lines
(( $I % $WIDTH )) || echo -e "\e[0m"
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

View File

@ -0,0 +1,129 @@
#compdef celery
#autoload
#celery zsh completion
_celery () {
local -a _1st_arguments ifargs dopts controlargs
typeset -A opt_args
_1st_arguments=('worker' 'events' 'beat' 'shell' 'multi' 'amqp' 'status' 'inspect' \
'control' 'purge' 'list' 'migrate' 'call' 'result' 'report')
ifargs=('--app=' '--broker=' '--loader=' '--config=' '--version')
dopts=('--detach' '--umask=' '--gid=' '--uid=' '--pidfile=' '--logfile=' '--loglevel=')
controlargs=('--timeout' '--destination')
_arguments \
'(-A --app=)'{-A,--app}'[app instance to use (e.g. module.attr_name):APP]' \
'(-b --broker=)'{-b,--broker}'[url to broker. default is "amqp://guest@localhost//":BROKER]' \
'(--loader)--loader[name of custom loader class to use.:LOADER]' \
'(--config)--config[Name of the configuration module:CONFIG]' \
'(--workdir)--workdir[Optional directory to change to after detaching.:WORKING_DIRECTORY]' \
'(-q --quiet)'{-q,--quiet}'[Don"t show as much output.]' \
'(-C --no-color)'{-C,--no-color}'[Don"t display colors.]' \
'(--version)--version[show program"s version number and exit]' \
'(- : *)'{-h,--help}'[show this help message and exit]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "celery subcommand" _1st_arguments
return
fi
case "$words[1]" in
worker)
_arguments \
'(-C --concurrency=)'{-C,--concurrency=}'[Number of child processes processing the queue. The default is the number of CPUs.]' \
'(--pool)--pool=:::(processes eventlet gevent threads solo)' \
'(--purge --discard)'{--discard,--purge}'[Purges all waiting tasks before the daemon is started.]' \
'(-f --logfile=)'{-f,--logfile=}'[Path to log file. If no logfile is specified, stderr is used.]' \
'(--loglevel=)--loglevel=:::(critical error warning info debug)' \
'(-N --hostname=)'{-N,--hostname=}'[Set custom hostname, e.g. "foo.example.com".]' \
'(-B --beat)'{-B,--beat}'[Also run the celerybeat periodic task scheduler.]' \
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database if running with the -B option. Defaults to celerybeat-schedule.]' \
'(-S --statedb=)'{-S,--statedb=}'[Path to the state database.Default: None]' \
'(-E --events)'{-E,--events}'[Send events that can be captured by monitors like celeryev, celerymon, and others.]' \
'(--time-limit=)--time-limit=[nables a hard time limit (in seconds int/float) for tasks]' \
'(--soft-time-limit=)--soft-time-limit=[Enables a soft time limit (in seconds int/float) for tasks]' \
'(--maxtasksperchild=)--maxtasksperchild=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
'(-Q --queues=)'{-Q,--queues=}'[List of queues to enable for this worker, separated by comma. By default all configured queues are enabled.]' \
'(-I --include=)'{-I,--include=}'[Comma separated list of additional modules to import.]' \
'(--pidfile=)--pidfile=[Optional file used to store the process pid.]' \
'(--autoscale=)--autoscale=[Enable autoscaling by providing max_concurrency, min_concurrency.]' \
'(--autoreload)--autoreload[Enable autoreloading.]' \
'(--no-execv)--no-execv[Don"t do execv after multiprocessing child fork.]'
compadd -a ifargs
;;
inspect)
_values -s \
'active[dump active tasks (being processed)]' \
'active_queues[dump queues being consumed from]' \
'ping[ping worker(s)]' \
'registered[dump of registered tasks]' \
'report[get bugreport info]' \
'reserved[dump reserved tasks (waiting to be processed)]' \
'revoked[dump of revoked task ids]' \
'scheduled[dump scheduled tasks (eta/countdown/retry)]' \
'stats[dump worker statistics]'
compadd -a controlargs ifargs
;;
control)
_values -s \
'add_consumer[tell worker(s) to start consuming a queue]' \
'autoscale[change autoscale settings]' \
'cancel_consumer[tell worker(s) to stop consuming a queue]' \
'disable_events[tell worker(s) to disable events]' \
'enable_events[tell worker(s) to enable events]' \
'pool_grow[start more pool processes]' \
'pool_shrink[use less pool processes]' \
'rate_limit[tell worker(s) to modify the rate limit for a task type]' \
'time_limit[tell worker(s) to modify the time limit for a task type.]'
compadd -a controlargs ifargs
;;
multi)
_values -s \
'--nosplash[Don"t display program info.]' \
'--verbose[Show more output.]' \
'--no-color[Don"t display colors.]' \
'--quiet[Don"t show as much output.]' \
'start' 'restart' 'stopwait' 'stop' 'show' \
'names' 'expand' 'get' 'kill'
compadd -a ifargs
;;
amqp)
_values -s \
'queue.declare' 'queue.purge' 'exchange.delete' 'basic.publish' \
'exchange.declare' 'queue.delete' 'queue.bind' 'basic.get'
;;
list)
_values -s, 'bindings'
;;
shell)
_values -s \
'--ipython[force iPython.]' \
'--bpython[force bpython.]' \
'--python[force default Python shell.]' \
'--without-tasks[don"t add tasks to locals.]' \
'--eventlet[use eventlet.]' \
'--gevent[use gevent.]'
compadd -a ifargs
;;
beat)
_arguments \
'(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database. Defaults to celerybeat-schedule.]' \
'(-S --scheduler=)'{-S,--scheduler=}'[Scheduler class to use. Default is celery.beat.PersistentScheduler.]' \
'(--max-interval)--max-interval[]'
compadd -a dopts fargs
;;
events)
_arguments \
'(-d --dump)'{-d,--dump}'[Dump events to stdout.]' \
'(-c --camera=)'{-c,--camera=}'[Take snapshots of events using this camera.]' \
'(-F --frequency=)'{-F,--frequency=}'[Camera: Shutter frequency. Default is every 1.0 seconds.]' \
'(-r --maxrate=)'{-r,--maxrate=}'[Camera: Optional shutter rate limit (e.g. 10/m).]'
compadd -a dopts fargs
;;
*)
;;
esac
}

View File

@ -0,0 +1,99 @@
#
# INSTRUCTIONS
#
# With either a manual or brew installed chruby things should just work.
#
# If you'd prefer to specify an explicit path to load chruby from
# you can set variables like so:
#
# zstyle :omz:plugins:chruby path /local/path/to/chruby.sh
# zstyle :omz:plugins:chruby auto /local/path/to/auto.sh
#
# TODO
# - autodetermine correct source path on non OS X systems
# - completion if ruby-install exists
# rvm and rbenv plugins also provide this alias
alias rubies='chruby'
_homebrew-installed() {
whence brew &> /dev/null
}
_chruby-from-homebrew-installed() {
[ -r $(brew --prefix chruby) ] &> /dev/null
}
_ruby-build_installed() {
whence ruby-build &> /dev/null
}
_ruby-install-installed() {
whence ruby-install &> /dev/null
}
# Simple definition completer for ruby-build
if _ruby-build_installed; then
_ruby-build() { compadd $(ruby-build --definitions) }
compdef _ruby-build ruby-build
fi
_source_from_omz_settings() {
local _chruby_path
local _chruby_auto
zstyle -s :omz:plugins:chruby path _chruby_path
zstyle -s :omz:plugins:chruby auto _chruby_auto
if [[ -r ${_chruby_path} ]]; then
source ${_chruby_path}
fi
if [[ -r ${_chruby_auto} ]]; then
source ${_chruby_auto}
fi
}
_chruby_dirs() {
chrubydirs=($HOME/.rubies/ $PREFIX/opt/rubies)
for dir in chrubydirs; do
if [[ -d $dir ]]; then
RUBIES+=$dir
fi
done
}
if _homebrew-installed && _chruby-from-homebrew-installed ; then
source $(brew --prefix chruby)/share/chruby/chruby.sh
source $(brew --prefix chruby)/share/chruby/auto.sh
_chruby_dirs
elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
_chruby_dirs
else
_source_from_omz_settings
_chruby_dirs
fi
function ensure_chruby() {
$(whence chruby)
}
function current_ruby() {
local _ruby
_ruby="$(chruby |grep \* |tr -d '* ')"
if [[ $(chruby |grep -c \*) -eq 1 ]]; then
echo ${_ruby}
else
echo "system"
fi
}
function chruby_prompt_info() {
echo "$(current_ruby)"
}
# complete on installed rubies
_chruby() { compadd $(chruby | tr -d '* ') }
compdef _chruby chruby

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,28 @@
# chucknorris: Chuck Norris fortunes
# Automatically generate or update Chuck's compiled fortune data file
# $0 must be used outside a local function. This variable name is unlikly to collide.
CHUCKNORRIS_PLUGIN_DIR=${0:h}
() {
local DIR=$CHUCKNORRIS_PLUGIN_DIR/fortunes
if [[ ! -f $DIR/chucknorris.dat ]] || [[ $DIR/chucknorris.dat -ot $DIR/chucknorris ]]; then
# For some reason, Cygwin puts strfile in /usr/sbin, which is not on the path by default
local strfile=strfile
if ! which strfile &>/dev/null && [[ -f /usr/sbin/strfile ]]; then
strfile=/usr/sbin/strfile
fi
if which $strfile &> /dev/null; then
$strfile $DIR/chucknorris $DIR/chucknorris.dat >/dev/null
else
echo "[oh-my-zsh] chucknorris depends on strfile, which is not installed" >&2
echo "[oh-my-zsh] strfile is often provided as part of the 'fortune' package" >&2
fi
fi
# Aliases
alias chuck="fortune -a $DIR"
alias chuck_cow="chuck | cowthink"
}
unset CHUCKNORRIS_PLUGIN_DIR

View File

@ -0,0 +1,907 @@
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.
%

View File

@ -0,0 +1,2 @@
#!/bin/zsh
alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb

View File

@ -0,0 +1,60 @@
#!/usr/bin/env ruby
#
# cloudapp
# Zach Holman / @holman
#
# Uploads a file from the command line to CloudApp, drops it into your
# clipboard (on a Mac, at least).
#
# Example:
#
# cloudapp drunk-blake.png
#
# This requires Aaron Russell's cloudapp_api gem:
#
# gem install cloudapp_api
#
# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
#
# email
# password
require 'rubygems'
begin
require 'cloudapp_api'
rescue LoadError
puts "You need to install cloudapp_api: gem install cloudapp_api"
exit!(1)
end
config_file = "#{ENV['HOME']}/.cloudapp"
unless File.exist?(config_file)
puts "You need to type your email and password (one per line) into "+
"`~/.cloudapp`"
exit!(1)
end
email,password = File.read(config_file).split("\n")
class HTTParty::Response
# Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
# LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
def ok? ; true end
end
if ARGV[0].nil?
puts "You need to specify a file to upload."
exit!(1)
end
CloudApp.authenticate(email,password)
url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
# Say it for good measure.
puts "Uploaded to #{url}."
# Get the embed link.
url = "#{url}/#{ARGV[0].split('/').last}"
# Copy it to your (Mac's) clipboard.
`echo '#{url}' | tr -d "\n" | pbcopy`

View File

@ -0,0 +1,82 @@
#compdef codeclimate
_codeclimate_all_engines() {
engines_all=(`codeclimate engines:list | tail -n +2 | gawk '{ print $2 }' | gawk -F: '{ print $1 }'`)
}
_codeclimate_installed_engines() {
_codeclimate_all_engines
engines_installed=()
if [ -e .codeclimate.yml ]
then
for engine in $engines_all
do
if grep -q $engine ".codeclimate.yml"
then
engines_installed+=$engine
fi
done
fi
}
_codeclimate_not_installed_engines() {
_codeclimate_all_engines
engines_not_installed=()
if [ -e .codeclimate.yml ]
then
for engine in $engines_all
do
if ! grep -q $engine ".codeclimate.yml"
then
engines_not_installed+=$engine
fi
done
fi
}
local curcontext="$curcontext" state line ret=1
local expl
local -a engines_all engines_installed engines_not_installed
_arguments \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "bundle command" \
"analyze[Analyze all relevant files in the current working directory]" \
"console[Start an interactive session providing access to the classes within the CLI]" \
"engines\:disable[Prevents the engine from being used in this project]" \
"engines\:enable[This engine will be run the next time your project is analyzed]" \
"engines\:install[Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines]" \
"engines\:list[Lists all available engines in the Code Climate Docker Hub]" \
"engines\:remove[Removes an engine from your .codeclimate.yml file]" \
"help[Displays a list of commands that can be passed to the Code Climate CLI]" \
"init[Generates a new .codeclimate.yml file in the current working directory]" \
"validate-config[Validates the .codeclimate.yml file in the current working directory]" \
"version[Displays the current version of the Code Climate CLI]"
ret=0
;;
args)
case $line[1] in
engines:enable)
_codeclimate_not_installed_engines
_wanted engines_not_installed expl 'not installed engines' compadd -a engines_not_installed ;;
engines:disable|engines:remove)
_codeclimate_installed_engines
_wanted engines_installed expl 'installed engines' compadd -a engines_installed ;;
analyze)
_arguments \
'-f:Output Format:(text json)'
ret=0
;;
esac
;;
esac
return ret

View File

@ -0,0 +1,31 @@
## Coffeescript Plugin
This plugin provides aliases for quickly compiling and previewing your
coffeescript 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 b 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,81 @@
#compdef coffee
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Dong Weiming (https://github.com/dongweiming)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1 version opts first second third
typeset -A opt_args
version=(${(f)"$(_call_program version $words[1] --version)"})
version=${${(z)${version[1]}}[3]}
first=$(echo $version|cut -d '.' -f 1)
second=$(echo $version|cut -d '.' -f 2)
third=$(echo $version|cut -d '.' -f 3)
if (( $first < 2 )) && (( $second < 7 )) && (( $third < 3 ));then
opts+=('(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]'
'(-r --require)'{-r,--require}'[require a library before executing your script]:library')
fi
_arguments -C \
'(- *)'{-h,--help}'[display this help message]' \
'(- *)'{-v,--version}'[display the version number]' \
$opts \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
'*:script or directory:_files' && ret=0
return ret
# 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

@ -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" | clipcopy
}
# compile from clipboard & print
alias cfp='cf "$(clippaste)"'
# compile from clipboard and copy to clipboard
alias cfpc='cfp | clipcopy'

View File

@ -0,0 +1,6 @@
n forw-line
e back-line
k repeat-search
\ek repeat-search-all
K reverse-search
\eK reverse-search-all

View File

@ -0,0 +1,22 @@
# ctrl-j newline
bindkey '^n' accept-line
bindkey -a '^n' accept-line
# another rotation to match qwerty
bindkey -a 'n' down-line-or-history
bindkey -a 'e' up-line-or-history
bindkey -a 'i' vi-forward-char
# make qwerty
bindkey -a 'k' vi-repeat-search
bindkey -a 'K' vi-rev-repeat-search
bindkey -a 'u' vi-insert
bindkey -a 'U' vi-insert-bol
bindkey -a 'l' vi-undo-change
bindkey -a 'N' vi-join
# spare
bindkey -a 'j' vi-forward-word-end
bindkey -a 'J' vi-forward-blank-word-end
lesskey $ZSH/plugins/colemak/colemak-less

View File

@ -0,0 +1,32 @@
if [[ "$OSTYPE" = solaris* ]]
then
if [[ ! -x "$HOME/bin/nroff" ]]
then
mkdir -p "$HOME/bin"
cat > "$HOME/bin/nroff" <<EOF
#!/bin/sh
if [ -n "\$_NROFF_U" -a "\$1,\$2,\$3" = "-u0,-Tlp,-man" ]; then
shift
exec /usr/bin/nroff -u\$_NROFF_U "\$@"
fi
#-- Some other invocation of nroff
exec /usr/bin/nroff "\$@"
EOF
chmod +x "$HOME/bin/nroff"
fi
fi
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
PAGER="${commands[less]:-$PAGER}" \
_NROFF_U=1 \
PATH="$HOME/bin:$PATH" \
man "$@"
}

View File

@ -0,0 +1,28 @@
# Plugin for highlighting file content
# Plugin highlights file content based on the filename extension.
# If no highlighting method supported for given extension then it tries
# guess it by looking for file content.
alias colorize='colorize_via_pygmentize'
colorize_via_pygmentize() {
if [ ! -x "$(which pygmentize)" ]; then
echo "package \'pygmentize\' is not installed!"
return -1
fi
if [ $# -eq 0 ]; then
pygmentize -g $@
fi
for FNAME in $@
do
filename=$(basename "$FNAME")
lexer=`pygmentize -N \"$filename\"`
if [ "Z$lexer" != "Ztext" ]; then
pygmentize -l $lexer "$FNAME"
else
pygmentize -g "$FNAME"
fi
done
}

View File

@ -0,0 +1,33 @@
# Uses the command-not-found package zsh support
# as seen in http://www.porcheron.info/command-not-found-for-zsh/
# this is installed in Ubuntu
[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
# Arch Linux command-not-found support, you must have package pkgfile installed
# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
# Fedora command-not-found support
if [ -f /usr/libexec/pk-command-not-found ]; then
command_not_found_handler () {
runcnf=1
retval=127
[ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0
[ ! -x /usr/libexec/packagekitd ] && runcnf=0
if [ $runcnf -eq 1 ]
then
/usr/libexec/pk-command-not-found $@
retval=$?
fi
return $retval
}
fi
# OSX command-not-found support
# https://github.com/Homebrew/homebrew-command-not-found
if type brew &> /dev/null; then
if brew command command-not-found-init > /dev/null 2>&1; then
eval "$(brew command-not-found-init)";
fi
fi

View File

@ -0,0 +1,89 @@
# Advanced Aliases.
# Use with caution
#
# ls, the common ones I use a lot shortened for rapid fire usage
alias l='ls -lFh' #size,show type,human readable
alias la='ls -lAFh' #long list,show almost all,show type,human readable
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
alias ll='ls -l' #long list
alias ldot='ls -ld .*'
alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'
alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file
alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f'
# Command line head / tail shortcuts
alias -g H='| head'
alias -g T='| tail'
alias -g G='| grep'
alias -g L="| less"
alias -g M="| most"
alias -g LL="2>&1 | less"
alias -g CA="2>&1 | cat -A"
alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
alias -g P="2>&1| pygmentize -l pytb"
alias dud='du -d 1 -h'
alias duf='du -sh *'
alias fd='find . -type d -name'
alias ff='find . -type f -name'
alias h='history'
alias hgrep="fc -El 0 | grep"
alias help='man'
alias p='ps -f'
alias sortnr='sort -n -r'
alias unexport='unset'
alias whereami=display_info
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# zsh is able to auto-do some kungfoo
# depends on the SUFFIX :)
if is-at-least 4.2.0; then
# open browser on urls
if [[ -n "$BROWSER" ]]; then
_browser_fts=(htm html de org net com at cx nl se dk)
for ft in $_browser_fts; do alias -s $ft=$BROWSER; done
fi
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
for ft in $_editor_fts; do alias -s $ft=$EDITOR; done
if [[ -n "$XIVIEWER" ]]; then
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done
fi
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
for ft in $_media_fts; do alias -s $ft=mplayer; done
#read documents
alias -s pdf=acroread
alias -s ps=gv
alias -s dvi=xdvi
alias -s chm=xchm
alias -s djvu=djview
#list whats inside packed file
alias -s zip="unzip -l"
alias -s rar="unrar l"
alias -s tar="tar tf"
alias -s tar.gz="echo "
alias -s ace="unace l"
fi
# Make zsh know about hosts already accessed by SSH
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'

View File

@ -0,0 +1,20 @@
# ------------------------------------------------------------------------------
# FILE: compleat.plugin.zsh
# DESCRIPTION: oh-my-zsh plugin file.
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
if (( ${+commands[compleat]} )); then
local prefix="${commands[compleat]:h:h}"
local setup="${prefix}/share/compleat-1.0/compleat_setup"
if [[ -f "$setup" ]]; then
if ! bashcompinit >/dev/null 2>&1; then
autoload -U bashcompinit
bashcompinit -i
fi
source "$setup"
fi
fi

View File

@ -0,0 +1,55 @@
# ------------------------------------------------------------------------------
# FILE: composer.plugin.zsh
# DESCRIPTION: oh-my-zsh composer plugin file.
# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# Composer basic command completion
_composer_get_command_list () {
$_comp_command1 --no-ansi 2>/dev/null | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
}
_composer_get_required_list () {
$_comp_command1 show -s --no-ansi 2>/dev/null | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
}
_composer () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'1: :->command'\
'*: :->args'
case $state in
command)
compadd $(_composer_get_command_list)
;;
*)
compadd $(_composer_get_required_list)
;;
esac
}
compdef _composer composer
compdef _composer composer.phar
# Aliases
alias c='composer'
alias csu='composer self-update'
alias cu='composer update'
alias cr='composer require'
alias crm='composer remove'
alias ci='composer install'
alias ccp='composer create-project'
alias cdu='composer dump-autoload'
alias cdo='composer dump-autoload --optimize-autoloader'
alias cgu='composer global update'
alias cgr='composer global require'
alias cgrm='composer global remove'
# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'
# Add Composer's global binaries to PATH
export PATH=$PATH:$(composer global config bin-dir --absolute) 2>/dev/null

View File

@ -0,0 +1,11 @@
# `copybuffer` plugin
This plugin binds the ctrl-o keyboard shortcut to a command that copies the text
that is currently typed in the command line ($BUFFER) to the system clipboard.
This is useful if you type a command - and before you hit enter to execute it - want
to copy it maybe so you can paste it into a script, gist or whatnot.
```zsh
plugins=(... copybuffer)
```

View File

@ -0,0 +1,14 @@
# copy the active line from the command line buffer
# onto the system clipboard (requires clipcopy plugin)
copybuffer () {
if which clipcopy &>/dev/null; then
echo $BUFFER | clipcopy
else
echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly."
fi
}
zle -N copybuffer
bindkey "^O" copybuffer

View File

@ -0,0 +1,5 @@
# Copies the pathname of the current directory to the system or X Windows clipboard
function copydir {
emulate -L zsh
print -n $PWD | clipcopy
}

View File

@ -0,0 +1,7 @@
# Copies the contents of a given file to the system or X Windows clipboard
#
# copyfile <file>
function copyfile {
emulate -L zsh
clipcopy $1
}

View File

@ -0,0 +1,32 @@
# cp plugin
This plugin defines a `cpv` function that uses `rsync` so that you
get the features and security of this command.
To enable, add `cp` to your `plugins` array in your zshrc file:
```zsh
plugins=(... cp)
```
## Description
The enabled options for rsync are:
- `-p`: preserves permissions.
- `-o`: preserves owner.
* `-g`: preserves group.
* `-b`: make a backup of the original file instead of overwriting it, if it exists.
* `-r`: recurse directories.
* `-hhh`: outputs numbers in human-readable format, in units of 1024 (K, M, G, T).
* `--backup-dir=/tmp/rsync`: move backup copies to "/tmp/rsync".
* `-e /dev/null`: only work on local files (disable remote shells).
* `--progress`: display progress.

View File

@ -0,0 +1,4 @@
cpv() {
rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@"
}
compdef _files cpv

View File

@ -0,0 +1,67 @@
#compdef cpanm
##
# cpanminus Z Shell completion script
##
#
# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011)
#
# The latest code is always located at:
# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
#
local arguments curcontext="$curcontext"
typeset -A opt_args
arguments=(
# Commands
# '(--install -i)'{--install,-i}'[Installs the modules]'
'(- :)--self-upgrade[Upgrades itself]'
'(- :)--info[Displays distribution info on CPAN]'
'(--installdeps)--installdeps[Only install dependencies]'
'(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
'(- :)'{--help,-h}'[Displays help information]'
'(- :)'{--version,-V}'[Displays software version]'
# Options
{--force,-f}'[Force install]'
{--notest,-n}'[Do not run unit tests]'
{--sudo,-S}'[sudo to run install commands]'
'(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
'(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
{--local-lib,-l}'[Specify the install base to install modules]'
{--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
'--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
'--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
'--prompt[Prompt when configure/build/test fails]'
'--reinstall[Reinstall the distribution even if you already have the latest version installed]'
'--interactive[Turn on interactive configure]'
'--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
'--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
'--save-dists[Specify the optional directory path to copy downloaded tarballs]'
# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
'--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
'(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
'(--man-pages)--no-man-pages[Do not generate man pages]'
# Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
# Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
# (So that the exclusions are not enabled here for the completion)
'(--lwp)--lwp[Use LWP module to download stuff]'
'(--wget)--wget[Use GNU Wget (if available) to download stuff]'
'(--curl)--curl[Use cURL (if available) to download stuff]'
# Other completions
'*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
# '*::args: _normal' # this looks for default files (any files)
)
_arguments -s $arguments \
&& return 0
return 1

View File

@ -0,0 +1,229 @@
# Authors:
# https://github.com/AlexBio
# https://github.com/dbb
# https://github.com/Mappleconfusers
#
# Debian-related zsh aliases and functions for zsh
# Use aptitude if installed, or apt-get if not.
# You can just set apt_pref='apt-get' to override it.
if [[ -e $( which -p aptitude 2>&1 ) ]]; then
apt_pref='aptitude'
apt_upgr='safe-upgrade'
else
apt_pref='apt-get'
apt_upgr='upgrade'
fi
# Use sudo by default if it's installed
if [[ -e $( which -p sudo 2>&1 ) ]]; then
use_sudo=1
fi
# Aliases ###################################################################
# These are for more obscure uses of apt-get and aptitude that aren't covered
# below.
alias age='apt-get'
alias api='aptitude'
# Some self-explanatory aliases
alias acs="apt-cache search"
alias aps='aptitude search'
alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
--no-gui --disable-columns search" # search package
# apt-file
alias afs='apt-file search --regexp'
# These are apt-get only
alias asrc='apt-get source'
alias app='apt-cache policy'
# superuser operations ######################################################
if [[ $use_sudo -eq 1 ]]; then
# commands using sudo #######
alias aac='sudo $apt_pref autoclean'
alias abd='sudo $apt_pref build-dep'
alias ac='sudo $apt_pref clean'
alias ad='sudo $apt_pref update'
alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr'
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
alias afu='sudo apt-file update'
alias ag='sudo $apt_pref $apt_upgr'
alias ai='sudo $apt_pref install'
# Install all packages given on the command line while using only the first word of each line:
# acs ... | ail
alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install'
alias ap='sudo $apt_pref purge'
alias ar='sudo $apt_pref remove'
# apt-get only
alias ads='sudo apt-get dselect-upgrade'
# Install all .deb files in the current directory.
# Warning: you will need to put the glob in single quotes if you use:
# glob_subst
alias dia='sudo dpkg -i ./*.deb'
alias di='sudo dpkg -i'
# Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
?not(~n`uname -r`))'
# commands using su #########
else
alias aac='su -ls \'$apt_pref autoclean\' root'
abd() {
cmd="su -lc '$apt_pref build-dep $@' root"
print "$cmd"
eval "$cmd"
}
alias ac='su -ls \'$apt_pref clean\' root'
alias ad='su -lc \'$apt_pref update\' root'
alias adg='su -lc \'$apt_pref update && aptitude $apt_upgr\' root'
alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root'
alias afu='su -lc "apt-file update"'
alias ag='su -lc \'$apt_pref $apt_upgr\' root'
ai() {
cmd="su -lc 'aptitude -P install $@' root"
print "$cmd"
eval "$cmd"
}
ap() {
cmd="su -lc '$apt_pref -P purge $@' root"
print "$cmd"
eval "$cmd"
}
ar() {
cmd="su -lc '$apt_pref -P remove $@' root"
print "$cmd"
eval "$cmd"
}
# Install all .deb files in the current directory
# Assumes glob_subst is off
alias dia='su -lc "dpkg -i ./*.deb" root'
alias di='su -lc "dpkg -i" root'
# Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
?not(~n`uname -r`))'\'' root'
fi
# Completion ################################################################
#
# Registers a compdef for $1 that calls $apt_pref with the commands $2
# To do that it creates a new completion function called _apt_pref_$2
#
apt_pref_compdef() {
local f fb
f="_apt_pref_${2}"
eval "function ${f}() {
shift words;
service=\"\$apt_pref\";
words=(\"\$apt_pref\" '$2' \$words);
((CURRENT++))
test \"\${apt_pref}\" = 'aptitude' && _aptitude || _apt
}"
compdef "$f" "$1"
}
apt_pref_compdef aac "autoclean"
apt_pref_compdef abd "build-dep"
apt_pref_compdef ac "clean"
apt_pref_compdef ad "update"
apt_pref_compdef afu "update"
apt_pref_compdef ag "$apt_upgr"
apt_pref_compdef ai "install"
apt_pref_compdef ail "install"
apt_pref_compdef ap "purge"
apt_pref_compdef ar "remove"
apt_pref_compdef ads "dselect-upgrade"
# Misc. #####################################################################
# print all installed packages
alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
# Create a basic .deb package
alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
# Functions #################################################################
# create a simple script that can be used to 'duplicate' a system
apt-copy() {
print '#!/bin/sh'"\n" > apt-copy.sh
cmd='$apt_pref install'
for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; {
cmd="${cmd} ${p}"
}
print $cmd "\n" >> apt-copy.sh
chmod +x apt-copy.sh
}
# Prints apt history
# Usage:
# apt-history install
# apt-history upgrade
# apt-history remove
# apt-history rollback
# apt-history list
# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
apt-history () {
case "$1" in
install)
zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
;;
upgrade|remove)
zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
;;
rollback)
zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
grep "$2" -A10000000 | \
grep "$3" -B10000000 | \
awk '{print $4"="$5}'
;;
list)
zgrep --no-filename '' $(ls -rt /var/log/dpkg*)
;;
*)
echo "Parameters:"
echo " install - Lists all packages that have been installed."
echo " upgrade - Lists all packages that have been upgraded."
echo " remove - Lists all packages that have been removed."
echo " rollback - Lists rollback information."
echo " list - Lists all contains of dpkg logs."
;;
esac
}
# Kernel-package building shortcut
kerndeb () {
# temporarily unset MAKEFLAGS ( '-j3' will fail )
MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
appendage='-custom' # this shows up in $ (uname -r )
revision=$(date +"%Y%m%d") # this shows up in the .deb file name
make-kpkg clean
time fakeroot make-kpkg --append-to-version "$appendage" --revision \
"$revision" kernel_image kernel_headers
}
# List packages by size
function apt-list-packages {
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \
grep -v deinstall | \
sort -n | \
awk '{print $1" "$2}'
}

View File

@ -0,0 +1,49 @@
# enables cycling through the directory stack using
# Ctrl+Shift+Left/Right
#
# left/right direction follows the order in which directories
# were visited, like left/right arrows do in a browser
# NO_PUSHD_MINUS syntax:
# pushd +N: start counting from left of `dirs' output
# pushd -N: start counting from right of `dirs' output
switch-to-dir () {
[[ ${#dirstack} -eq 0 ]] && return
while ! builtin pushd -q $1 &>/dev/null; do
# We found a missing directory: pop it out of the dir stack
builtin popd -q $1
# Stop trying if there are no more directories in the dir stack
[[ ${#dirstack} -eq 0 ]] && break
done
}
insert-cycledleft () {
emulate -L zsh
setopt nopushdminus
switch-to-dir +1
zle reset-prompt
}
zle -N insert-cycledleft
insert-cycledright () {
emulate -L zsh
setopt nopushdminus
switch-to-dir -0
zle reset-prompt
}
zle -N insert-cycledright
# These sequences work for xterm, Apple Terminal.app, and probably others.
# Not for rxvt-unicode, but it doesn't seem differentiate Ctrl-Shift-Arrow
# from plain Shift-Arrow, at least by default.
# iTerm2 does not have these key combinations defined by default; you will need
# to add them under "Keys" in your profile if you want to use this. You can do
# this conveniently by loading the "xterm with Numeric Keypad" preset.
bindkey "\e[1;6D" insert-cycledleft
bindkey "\e[1;6C" insert-cycledright

View File

@ -0,0 +1,133 @@
##
# Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories
# that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
#
dirhistory_past=($PWD)
dirhistory_future=()
export dirhistory_past
export dirhistory_future
export DIRHISTORY_SIZE=30
# Pop the last element of dirhistory_past.
# Pass the name of the variable to return the result in.
# Returns the element if the array was not empty,
# otherwise returns empty string.
function pop_past() {
eval "$1='$dirhistory_past[$#dirhistory_past]'"
if [[ $#dirhistory_past -gt 0 ]]; then
dirhistory_past[$#dirhistory_past]=()
fi
}
function pop_future() {
eval "$1='$dirhistory_future[$#dirhistory_future]'"
if [[ $#dirhistory_future -gt 0 ]]; then
dirhistory_future[$#dirhistory_future]=()
fi
}
# Push a new element onto the end of dirhistory_past. If the size of the array
# is >= DIRHISTORY_SIZE, the array is shifted
function push_past() {
if [[ $#dirhistory_past -ge $DIRHISTORY_SIZE ]]; then
shift dirhistory_past
fi
if [[ $#dirhistory_past -eq 0 || $dirhistory_past[$#dirhistory_past] != "$1" ]]; then
dirhistory_past+=($1)
fi
}
function push_future() {
if [[ $#dirhistory_future -ge $DIRHISTORY_SIZE ]]; then
shift dirhistory_future
fi
if [[ $#dirhistory_future -eq 0 || $dirhistory_futuret[$#dirhistory_future] != "$1" ]]; then
dirhistory_future+=($1)
fi
}
# Called by zsh when directory changes
chpwd_functions+=(chpwd_dirhistory)
function chpwd_dirhistory() {
push_past $PWD
# If DIRHISTORY_CD is not set...
if [[ -z "${DIRHISTORY_CD+x}" ]]; then
# ... clear future.
dirhistory_future=()
fi
}
function dirhistory_cd(){
DIRHISTORY_CD="1"
cd $1
unset DIRHISTORY_CD
}
# Move backward in directory history
function dirhistory_back() {
local cw=""
local d=""
# Last element in dirhistory_past is the cwd.
pop_past cw
if [[ "" == "$cw" ]]; then
# Someone overwrote our variable. Recover it.
dirhistory_past=($PWD)
return
fi
pop_past d
if [[ "" != "$d" ]]; then
dirhistory_cd $d
push_future $cw
else
push_past $cw
fi
}
# Move forward in directory history
function dirhistory_forward() {
local d=""
pop_future d
if [[ "" != "$d" ]]; then
dirhistory_cd $d
push_past $d
fi
}
# Bind keys to history navigation
function dirhistory_zle_dirhistory_back() {
# Erase current line in buffer
zle kill-buffer
dirhistory_back
zle accept-line
}
function dirhistory_zle_dirhistory_future() {
# Erase current line in buffer
zle kill-buffer
dirhistory_forward
zle accept-line
}
zle -N dirhistory_zle_dirhistory_back
# xterm in normal mode
bindkey "\e[3D" dirhistory_zle_dirhistory_back
bindkey "\e[1;3D" dirhistory_zle_dirhistory_back
# Putty:
bindkey "\e\e[D" dirhistory_zle_dirhistory_back
# GNU screen:
bindkey "\eO3D" dirhistory_zle_dirhistory_back
zle -N dirhistory_zle_dirhistory_future
bindkey "\e[3C" dirhistory_zle_dirhistory_future
bindkey "\e[1;3C" dirhistory_zle_dirhistory_future
bindkey "\e\e[C" dirhistory_zle_dirhistory_future
bindkey "\eO3C" dirhistory_zle_dirhistory_future

View File

@ -0,0 +1,20 @@
# Save dirstack history to .zdirs
# adapted from:
# github.com/grml/grml-etc-core/blob/master/etc/zsh/zshrc#L1547
DIRSTACKSIZE=${DIRSTACKSIZE:-20}
dirstack_file=${dirstack_file:-${HOME}/.zdirs}
if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
dirstack=( ${(f)"$(< $dirstack_file)"} )
# "cd -" won't work after login by just setting $OLDPWD, so
[[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
fi
chpwd_functions+=(chpwd_dirpersist)
chpwd_dirpersist() {
if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
local -ax my_stack
my_stack=( ${PWD} ${dirstack} )
builtin print -l ${(u)my_stack} >! ${dirstack_file}
}

View File

@ -0,0 +1,402 @@
#compdef manage.py
typeset -ga 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'
'--pythonpath=-[a directory to add to the Python path.]:directory:_directories'
'--traceback[print traceback on exception.]'
"--no-color[Don't colorize the command output.]"
"--version[show program's version number and exit.]"
{-h,--help}'[show this help message and exit.]'
)
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 : \
$tag_args \
$nul_args && ret=0
}
_managepy-changepassword(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-createcachetable(){
_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
}
_managepy-collectstatic(){
_arguments -s : \
'--link[Create a symbolic link to each file instead of copying.]' \
'--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.]' \
'--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.]' \
'--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 "*~".]' \
$noinput_args \
$nul_args && ret=0
}
_managepy-dbshell(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-diffsettings(){
_arguments -s : \
"--all[Display all settings, regardless of their value.]"
$nul_args && ret=0
}
_managepy-dumpdata(){
_arguments -s : \
'--format=-[Specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
'--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 \
'*::appname:_applist' && ret=0
}
_managepy-flush(){
_arguments -s : \
$no_init_data_args \
$db_args \
$noinput_args \
$nul_args && ret=0
}
_managepy-help(){
_arguments -s : \
'*:command:_managepy_cmds' \
$nul_args && ret=0
}
_managepy_cmds(){
local line
local -a cmd
_call_program help-command ./manage.py help \
|& sed -n '/^ /s/[(), ]/ /gp' \
| while read -A line; do cmd=($line $cmd) done
_describe -t managepy-command 'manage.py command' cmd
}
_managepy-inspectdb(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-loaddata(){
_arguments -s : \
'--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' \
$db_args \
$nul_args && ret=0
}
_managepy-makemessages(){
_arguments -s : \
'--locale=-[Creates or updates the message files for the given locale(s) (e.g. pt_BR).]' \
'--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
}
_managepy-runfcgi(){
local state
local fcgi_opts
fcgi_opts=(
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
'host[hostname to listen on..]:'
'port[port to listen on.]:'
'socket[UNIX socket to listen on.]:file:_files'
'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).]:'
'maxspare[max number of spare processes / threads.]:'
'minspare[min number of spare processes / threads.]:'
'maxchildren[hard limit number of processes / threads.]:'
'daemonize[whether to detach from terminal.]:boolean:(False True)'
'pidfile[write the spawned process-id to this file.]:file:_files'
'workdir[change to this directory when daemonizing.]:directory:_files'
'outlog[write stdout to this file.]:file:_files'
'errlog[write stderr to this file.]:file:_files'
)
_arguments -s : \
$nul_args \
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0
}
_managepy-runserver(){
_arguments -s : \
'--ipv6[Tells Django to use an IPv6 address.]' \
'--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
}
_managepy-shell(){
_arguments -s : \
'--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
}
_managepy-sql(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_managepy-sqlall(){
_arguments -s : \
$db_args \
$nul_args && ret=0
}
_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() {
_arguments -s : \
$noinput_args \
$no_init_data_args \
$db_args \
$nul_args && ret=0
}
_managepy-test() {
_arguments -s : \
'--failfast[Tells Django to stop running the test suite after first failed test.]' \
'--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' \
$nul_args && ret=0
}
_managepy-testserver() {
_arguments -s : \
'--addrport=-[port number or ipaddr:port to run the server on.]' \
'--ipv6[Tells Django to use an IPv6 address.]' \
$noinput_args \
'*::fixture:_files' \
$nul_args && ret=0
}
_managepy-validate() {
_arguments -s : \
$tag_args \
$nul_args && ret=0
}
_managepy-commands() {
local -a commands
commands=(
"changepassword:Change a user's password for django.contrib.auth."
'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.'
'dbshell:Runs the command-line client for the current DATABASE_ENGINE.'
"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.'
'flush:Executes ``sqlflush`` on the current database.'
'help:manage.py help.'
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
'loaddata:Installs the named fixture(s) in the 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,'
'runserver:Starts a lightweight Web server for development.'
'shell:Runs a Python interactive interpreter.'
'sql:Prints the CREATE TABLE SQL statements for the given app 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).'
'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.'
'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
"sqlinitialdata:RENAMED: see 'sqlcustom'"
'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."
"startproject:Creates a Django project directory structure for the given project name in this current directory."
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
'testserver:Runs a development server with data from the given fixture(s).'
'validate:Validates all installed models.'
)
_describe -t commands 'manage.py command' commands && ret=0
}
_applist() {
local line
local -a apps
_call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
bn=op.basename(op.abspath(op.curdir));[sys\\
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
| while read -A line; do apps=($line $apps) done
_values 'Application' $apps && ret=0
}
_managepy() {
local curcontext=$curcontext ret=1
if ((CURRENT == 2)); then
_managepy-commands
else
shift words
(( CURRENT -- ))
curcontext="${curcontext%:*:*}:managepy-$words[1]:"
_call_function ret _managepy-$words[1]
fi
}
compdef _managepy manage.py
compdef _managepy django
compdef _managepy django-admin
compdef _managepy django-admin.py
compdef _managepy django-manage

View File

@ -0,0 +1,25 @@
## Description
This plugin makes `dnf` usage easier by adding aliases for the most
common commands.
`dnf` is the new package manager for RPM-based distributions, which
replaces `yum`.
## Aliases
| Alias | Command | Description |
|-------|-------------------------|--------------------------|
| dnfl | `dnf list` | List packages |
| dnfli | `dnf list installed` | List installed packages |
| dnfgl | `dnf grouplist` | List package groups |
| dnfmc | `dnf makecache` | Generate metadata cache |
| dnfp | `dnf info` | Show package information |
| dnfs | `dnf search` | Search package |
| **Use `sudo`** |
| dnfu | `sudo dnf upgrade` | Upgrade package |
| dnfi | `sudo dnf install` | Install package |
| dnfgi | `sudo dnf groupinstall` | Install package group |
| dnfr | `sudo dnf remove` | Remove package |
| dnfgr | `sudo dnf groupremove` | Remove package group |
| dnfc | `sudo dnf clean all` | Clean cache |

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