Commit 00eb4658 authored by Andrew Janke's avatar Andrew Janke
Browse files

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

parents 47d19cc5 192de6bc
The MIT License The MIT License
Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) Copyright (c) 2009-2015 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
__Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interact with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
### Prerequisites
__Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
* Unix-based operating system (Mac OS X or Linux)
* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing-ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
* `git` should be installed
### Basic Installation
Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`.
#### via curl
`sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"`
#### via wget
`sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"`
## Using Oh My Zsh
### Plugins
Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
#### Enabling Plugins
If you spot a plugin (or several) that you would like to use with Oh My Zsh, you will need to edit the `~/.zshrc` file. Once you open it with your favorite editor, you'll see a spot to list all the plugins that you'd like Oh My Zsh to load in initialization.
For example, this line might begin to look like...
```shell
plugins=(git bundler osx rake ruby)
```
#### Using Plugins
Most plugins (should! we're working on this) include a __README__, which documents how to use them.
### Themes
We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out!
#### Selecting a Theme
_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just right (for him)._
Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
```shell
ZSH_THEME="robbyrussell"
```
To use a different theme, simple change the value to match the name of your desired theme. For example:
```shell
ZSH_THEME="agnoster" # (this is one of the fancy ones)
```
Open up a new terminal window and your prompt should look something like...
![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png)
In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes).
## Advanced Topics
If you're the type that likes to get their hands dirty, these sections might resonate.
### Advanced Installation
Some users may want to change the default path, or manually install Oh My Zsh.
#### Custom Directory
The default location is `~/.oh-my-zsh` (hidden in your home directory)
If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
```shell
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh
```
#### Manual Installation
##### 1. Clone the repository:
```shell
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
```
##### 2. *Optionally*, backup your existing `~/.zshrc` file:
```shell
cp ~/.zshrc ~/.zshrc.orig
```
##### 3. Create a new zsh configuration file
You can create a new zsh config file by copying the template that we included for you.
```shell
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
```
##### 4. Change your default shell
```shell
chsh -s /bin/zsh
```
##### 5. Initialize your new zsh configuration
Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
### Installation Problems
If you have any hiccups installing, here are a few common fixes.
* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
* If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.
### Custom Plugins and Themes
If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory.
If you have many functions that go well together, you can put them as a `XYZ.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
## Getting Updates
By default, you will be prompted to check for upgrades every few weeks. If you would like `oh-my-zsh` to automatically upgrade itself without prompting you, set the following in your `~/.zshrc`:
```shell
DISABLE_UPDATE_PROMPT=true
```
To disable automatic upgrades, set the following in your `~/.zshrc`:
```shell
DISABLE_AUTO_UPDATE=true
```
### Manual Updates
If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
```shell
upgrade_oh_my_zsh
```
Magic!
## Uninstalling Oh My Zsh
Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.
## Contributing
I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
### Do NOT send us themes
We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page.
## Contributors
Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome.
Thank you so much!
## Follow Us
We have an [@ohmyzsh](https://twitter.com/ohmyzsh) Twitter account. You should follow it.
## Merchandise
We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town!
## License
Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt).
!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
@oh-my-zsh@ is an open source, community-driven framework for managing your "Zsh":http://www.zsh.org/ configuration.
It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…
bq. "OH MY ZSHELL!"
h2. Setup
@oh-my-zsh@ should work with any recent release of "Zsh":http://www.zsh.org/. The minimum recommended version is *4.3.9*.
If not already installed, you can install "Zsh":http://www.zsh.org/ using the command-line.
h3. The automatic installer… do you trust me?
You can install this via the command-line with either @curl@ or @wget@.
h4. via @curl@:
@curl -L http://install.ohmyz.sh | sh@
h4. via @wget@:
@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
h4. *Optionally*, change the install directory:
The default location is @~/.oh-my-zsh@ (hidden in your home directory).
You can change the install directory with the @ZSH@ environment variable, either by running @export ZSH=/your/path@ before installing, or by setting it before the end of the install pipeline like this:
@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
h3. The manual way
1. Clone the repository:
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
2. *Optionally*, backup your existing @~/.zshrc@ file:
@cp ~/.zshrc ~/.zshrc.orig@
3. Create a new "Zsh":http://www.zsh.org/ config file by copying the "Zsh":http://www.zsh.org/ template we've provided:
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
4. Set "Zsh":http://www.zsh.org/ as your default shell:
@chsh -s /bin/zsh@
5. Start or restart "Zsh":http://www.zsh.org/ by opening a new command-line window.
h3. Problems?
You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to @oh-my-zsh@.
If you installed manually or changed the install location, check the @ZSH@ environment variable in @~/.zshrc@.
h2. Usage
* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's available)
** example: @plugins=(git osx ruby)@
* theme support: change the @ZSH_THEME@ environment variable in @~/.zshrc@
** take a look at the @themes/@ directory and the "wiki":https://wiki.github.com/robbyrussell/oh-my-zsh/themes to see what comes bundled with @oh-my-zsh@
* & much, much more… take a look at the @lib/@ directory to see what @oh-my-zsh@ has to offer…
h2. Useful
The "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty useful for tips.
h3. Customization
If you want to override any of the default behaviors, just add a new file (ending in @.zsh@) in the @custom/@ directory.
If you have many functions that go well together, you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin (see '"Usage":https://github.com/robbyrussell/oh-my-zsh#usage' above).
If you would like to override the functionality of a plugin distributed with @oh-my-zsh@, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
h3. Updates
By default you will be prompted to check for upgrades. If you would like @oh-my-zsh@ to automatically upgrade itself without prompting you, set the following in your @~/.zshrc@:
@DISABLE_UPDATE_PROMPT=true@
To disable upgrades entirely, set the following in your @~/.zshrc@:
@DISABLE_AUTO_UPDATE=true@
To upgrade directly from the command-line, just run @upgrade_oh_my_zsh@.
h3. Uninstalling
If you want to uninstall @oh-my-zsh@, just run @uninstall_oh_my_zsh@ from the command-line and it'll remove itself and revert you to @bash@ (or your previous "Zsh":http://www.zsh.org/ configuration).
h2. Help out!
I'm far from being a "Zsh":http://www.zsh.org/ expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
h3. (Don't) send us your theme (for now)!
-I'm hoping to collect a bunch of themes – you can see existing ones in the @themes/@ directory.-
We have enough themes for the time being. Please fork the project and add on in there – you can let people know how to grab it from there.
h2. Contributors
This project wouldn't exist without all of our awesome users and contributors: "view our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
Thank you so much!
...@@ -15,7 +15,12 @@ if [ "x$CASE_SENSITIVE" = "xtrue" ]; then ...@@ -15,7 +15,12 @@ if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset CASE_SENSITIVE unset CASE_SENSITIVE
else else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset HYPHEN_INSENSITIVE
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
fi
fi fi
zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-colors ''
...@@ -34,7 +39,6 @@ fi ...@@ -34,7 +39,6 @@ fi
# disable named-directories autocompletion # disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
cdpath=(.)
# Use caching so that commands like apt and dpkg complete are useable # Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1 zstyle ':completion::complete:*' use-cache 1
......
...@@ -24,9 +24,9 @@ alias d='dirs -v | head -10' ...@@ -24,9 +24,9 @@ alias d='dirs -v | head -10'
# List directory contents # List directory contents
alias lsa='ls -lah' alias lsa='ls -lah'
alias l='ls -la' alias l='ls -lah'
alias ll='ls -l' alias ll='ls -lh'
alias la='ls -lA' alias la='ls -lAh'
# Push and pop directories on directory stack # Push and pop directories on directory stack
alias pu='pushd' alias pu='pushd'
......
...@@ -15,6 +15,22 @@ function take() { ...@@ -15,6 +15,22 @@ function take() {
cd $1 cd $1
} }
function open_command() {
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd="open" ;;
cygwin*) open_cmd="cygstart" ;;
linux*) open_cmd="xdg-open" ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
nohup $open_cmd "$@" &>/dev/null
}
# #
# Get the value of an alias. # Get the value of an alias.
# #
......
...@@ -36,24 +36,27 @@ git_remote_status() { ...@@ -36,24 +36,27 @@ git_remote_status() {
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [ $ahead -eq 0 ] && [ $behind -gt 0 ] if [ $ahead -gt 0 ] && [ $behind -eq 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
elif [ $ahead -gt 0 ] && [ $behind -eq 0 ] git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [ $behind -gt 0 ] && [ $ahead -eq 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [ $ahead -gt 0 ] && [ $behind -gt 0 ] elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
then then
echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi fi
fi
}
# Checks if there are commits ahead from remote if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]
function git_prompt_ahead() { then
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi
fi
echo $git_remote_status
fi
} }
# Gets the number of commits ahead from remote # Gets the number of commits ahead from remote
...@@ -64,6 +67,29 @@ function git_commits_ahead() { ...@@ -64,6 +67,29 @@ function git_commits_ahead() {
fi fi
} }
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
fi
}
# Formats prompt string for current git commit short SHA # Formats prompt string for current git commit short SHA
function git_prompt_short_sha() { function git_prompt_short_sha() {
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
......
...@@ -3,8 +3,12 @@ grep-flag-available() { ...@@ -3,8 +3,12 @@ grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1 echo | grep $1 "" >/dev/null 2>&1
} }
GREP_OPTIONS=""
# color grep results # color grep results
GREP_OPTIONS="--color=auto" if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available) # ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}" VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"
......
## smart urls ## Load smart urls if available
autoload -U url-quote-magic for d in $fpath; do
zle -N self-insert url-quote-magic if [[ -e "$d/url-quote-magic" ]]; then
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
fi
done
## jobs ## jobs
setopt long_list_jobs setopt long_list_jobs
...@@ -20,3 +24,6 @@ alias afind='ack-grep -il' ...@@ -20,3 +24,6 @@ alias afind='ack-grep -il'
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
fi fi
# recognize comments
setopt interactivecomments
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
# Limited support for Apple Terminal (Terminal can't set window and tab separately) # Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title { function title {
emulate -L zsh emulate -L zsh
setopt prompt_subst
[[ "$EMACS" == *term* ]] && return [[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default # if $2 is unset use $1 as default
...@@ -24,6 +26,10 @@ function title { ...@@ -24,6 +26,10 @@ function title {
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt # Runs before showing the prompt
function omz_termsupport_precmd { function omz_termsupport_precmd {
...@@ -45,7 +51,7 @@ function omz_termsupport_preexec { ...@@ -45,7 +51,7 @@ function omz_termsupport_preexec {
setopt extended_glob setopt extended_glob
# cmd name only, or if this is sudo or ssh, the next cmd # cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%} local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}" local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<' title '$CMD' '%100>...>$LINE%<<'
......
...@@ -14,7 +14,7 @@ if [[ -z "$ZSH_CUSTOM" ]]; then ...@@ -14,7 +14,7 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom" ZSH_CUSTOM="$ZSH/custom"
fi fi
# Set ZSH_CACHE_DIR to the path where cache files sould be created # Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/ # or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache/" ZSH_CACHE_DIR="$ZSH/cache/"
......
...@@ -16,13 +16,22 @@ _1st_arguments=( ...@@ -16,13 +16,22 @@ _1st_arguments=(
'help:show the help message' 'help:show the help message'
'install:push this package file to the device and install it' 'install:push this package file to the device and install it'
'jdwp:list PIDs of processes hosting a JDWP transport' 'jdwp:list PIDs of processes hosting a JDWP transport'
'logcat:View device log' 'kill-server:kill the server if it is running'
'logcat:view device log'
'pull:copy file/dir from device' 'pull:copy file/dir from device'
'push:copy file/dir to device' 'push:copy file/dir to device'
'reboot:reboots the device, optionally into the bootloader or recovery program'
'reboot-bootloader:reboots the device into the bootloader'
'remount:remounts the partitions on the device read-write'
'root:restarts the adbd daemon with root permissions'
'sideload:push a ZIP to device and install it'
'shell:run remote shell interactively' 'shell:run remote shell interactively'
'sync:copy host->device only if changed (-l means list but dont copy)' 'sync:copy host->device only if changed (-l means list but dont copy)'
'start-server:ensure that there is a server running'
'tcpip:restart host adb in tcpip mode'
'uninstall:remove this app package from the device' 'uninstall:remove this app package from the device'
'version:show version num' 'version:show version num'
'wait-for-device:block until device is online'
) )
local expl local expl
......
## 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)
---
## ARCHLINUX PLUGIN
---
### FEATURES
| Alias | Function | Description |
|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
| pacin | sudo pacman -S | Install specific package(s) from the repositories |
| pacins | sudo pacman -U | Install specific package not from the repositories but from a file |
| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package |
| pacloc | pacman -Qi | Display information about a given package in the local database |
| paclocs | pacman -Qs | Search for package(s) in the local database |
| paclsorphans | sudo pacman -Qdt' | List all orphaned packages |
| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
| pacrep | pacman -Si | Display information about a given package in the repositories |
| pacreps | pacman -Ss | Search for package(s) in the repositories |
| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages |
| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories |
| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. |
| yaconf | yaourt -C | Fix all configuration files with vimdiff |
| yain | yaourt -S | Install specific package(s) from the repositories |
| yains | yaourt -U | Install specific package not from the repositories but from a file |
| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package |
| yaloc | yaourt -Qi | Display information about a given package in the local database |
| yalocs | yaourt -Qs | Search for package(s) in the local database |
| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") |
| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
| yaorph | yaourt -Qtd | Remove orphans using yaourt |
| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
| yarep | yaourt -Si | Display information about a given package in the repositories |
| yareps | yaourt -Ss | Search for package(s) in the repositories |
| yasu | yaourt --sucre | Same as yaupg, but without confirmation |
| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
| yaupd | yaourt -Sy | Update and refresh the local package database against repositories |
| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system |
| Function | Description |
|----------------|:------------------------------------------------------------------------------------------------------------------|
| pacdisowned | List all disowned files in your system |
| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) |
| pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | |
---
### CONTRIBUTORS
- Benjamin Boudreau - dreurmail@gmail.com
- Celso Miranda - contacto@celsomiranda.net
- KhasMek - Boushh@gmail.com
- Martin Putniorz - mputniorz@gmail.com
- MatthR3D - matthr3d@gmail.com
- ornicar - thibault.duplessis@gmail.com
---
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
# Look for yaourt, and add some useful functions if we have it. # Look for yaourt, and add some useful functions if we have it.
if [[ -x `which yaourt` ]]; then if [[ -x `command -v yaourt` ]]; then
upgrade () { upgrade () {
yaourt -Syu yaourt -Syu
} }
...@@ -21,11 +21,11 @@ if [[ -x `which yaourt` ]]; then ...@@ -21,11 +21,11 @@ if [[ -x `which yaourt` ]]; then
alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local")
alias yaorph='yaourt -Qtd' # Remove orphans using yaourt alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
# Additional yaourt alias examples # Additional yaourt alias examples
if [[ -x `which abs` && -x `which aur` ]]; then if [[ -x `command -v abs` && -x `command -v aur` ]]; then
alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
elif [[ -x `which abs` ]]; then elif [[ -x `command -v abs` ]]; then
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
elif [[ -x `which aur` ]]; then elif [[ -x `command -v aur` ]]; then
alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else else
alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
...@@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori ...@@ -49,11 +49,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
alias pacloc='pacman -Qi' # Display information about a given package in the local database alias pacloc='pacman -Qi' # Display information about a given package in the local database
alias paclocs='pacman -Qs' # Search for package(s) in the local database alias paclocs='pacman -Qs' # Search for package(s) in the local database
# Additional pacman alias examples # Additional pacman alias examples
if [[ -x `which abs` && -x `which aur` ]]; then if [[ -x `command -v abs` && -x `command -v aur` ]]; then
alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
elif [[ -x `which abs` ]]; then elif [[ -x `command -v abs` ]]; then
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
elif [[ -x `which aur` ]]; then elif [[ -x `command -v aur` ]]; then
alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
else else
alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
...@@ -63,7 +63,7 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li ...@@ -63,7 +63,7 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li
# https://bbs.archlinux.org/viewtopic.php?id=93683 # https://bbs.archlinux.org/viewtopic.php?id=93683
paclist() { paclist() {
sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' LC_ALL=C pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
} }
alias paclsorphans='sudo pacman -Qdt' alias paclsorphans='sudo pacman -Qdt'
......
## atom
Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
### Requirements
* [Atom](https://atom.io/)
### Usage
* If `at` command is called without an argument, launch Atom
* If `at` is passed a directory, `cd` to it and open it in Atom
* If `at` is passed a file, open it in Atom
* if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom
...@@ -13,7 +13,8 @@ function agp { ...@@ -13,7 +13,8 @@ function agp {
} }
function asp { function asp {
export AWS_DEFAULT_PROFILE=$1 export AWS_DEFAULT_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>" export AWS_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$RPROMPT"
} }
function aws_profiles { function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
...@@ -22,7 +23,7 @@ function aws_profiles { ...@@ -22,7 +23,7 @@ function aws_profiles {
compctl -K aws_profiles asp compctl -K aws_profiles asp
if _homebrew-installed && _awscli-homebrew-installed ; then if _homebrew-installed && _awscli-homebrew-installed ; then
_aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh
else else
_aws_zsh_completer_path=$(which aws_zsh_completer.sh) _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
fi fi
......
# 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
~~~
#!/usr/bin/env zsh
## setup ##
[[ -o interactive ]] || return #interactive only!
zmodload zsh/datetime || { print "can't load zsh/datetime"; return } # faster than date()
autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
(( ${+bgnotify_threshold} )) || bgnotify_threshold=5 #default 10 seconds
## definitions ##
if ! (type bgnotify_formatted | grep -q 'function'); then
function bgnotify_formatted {
## exit_status, command, elapsed_time
[ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
bgnotify "$title" "$2"
}
fi
currentWindowId () {
if hash osascript 2>/dev/null; then #osx
osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
elif hash notify-send 2>/dev/null; then #ubuntu!
xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
else
echo $EPOCHSECONDS #fallback for windows
fi
}
bgnotify () {
if hash terminal-notifier 2>/dev/null; then #osx
terminal-notifier -message "$2" -title "$1"
elif hash growlnotify 2>/dev/null; then #osx growl
growlnotify -m "$1" "$2"
elif hash notify-send 2>/dev/null; then #ubuntu!
notify-send "$1" "$2"
elif hash notifu 2>/dev/null; then #cygwyn support!
notifu /m "$2" /p "$1"
fi
}
## Zsh hooks ##
bgnotify_begin() {
bgnotify_timestamp=$EPOCHSECONDS
bgnotify_lastcmd=$1
bgnotify_windowid=$(currentWindowId)
}
bgnotify_end() {
didexit=$?
elapsed=$(( EPOCHSECONDS - bgnotify_timestamp ))
past_threshold=$(( elapsed >= bgnotify_threshold ))
if (( bgnotify_timestamp > 0 )) && (( past_threshold )); then
if [ $(currentWindowId) != "$bgnotify_windowid" ]; then
print -n "\a"
bgnotify_formatted "$didexit" "$bgnotify_lastcmd" "$elapsed"
fi
fi
bgnotify_timestamp=0 #reset it to 0!
}
add-zsh-hook preexec bgnotify_begin
add-zsh-hook precmd bgnotify_end
## Boot2docker autocomplete plugin
- Adds autocomplete options for all boot2docker commands.
Maintainer : Manfred Touron ([@moul](https://github.com/moul))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment