Merge pull request #2 from robbyrussell/master

Update fork
This commit is contained in:
Erwan ROUSSEL 2018-10-21 14:49:45 +02:00 committed by GitHub
commit 17fc4f6137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
305 changed files with 6231 additions and 1740 deletions

View File

@ -2,7 +2,7 @@
<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.
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
Sounds boring. Let's try again.
@ -12,7 +12,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo
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.
To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
## Getting Started
@ -21,7 +21,7 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
__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)
* [Zsh](https://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
@ -215,7 +215,7 @@ If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the co
## 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!
I'm far from being a [Zsh](https://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.
@ -238,7 +238,7 @@ We're on the social media.
## Merchandise
We have [stickers](https://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!
We have [stickers](https://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](https://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

View File

@ -1 +1,4 @@
# Put your custom themes in this folder.
# Example:
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "

View File

@ -1,4 +1,5 @@
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias cp='nocorrect cp'
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'

View File

@ -11,23 +11,20 @@ function upgrade_oh_my_zsh() {
}
function take() {
mkdir -p $1
cd $1
mkdir -p $@ && cd ${@:$#}
}
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*) [[ $(uname -a) =~ "Microsoft" ]] && \
open_cmd='cmd.exe /c start' || \
open_cmd='xdg-open' ;;
linux*) ! [[ $(uname -a) =~ "Microsoft" ]] && open_cmd='xdg-open' || {
open_cmd='cmd.exe /c start ""'
[[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
} ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
@ -36,9 +33,9 @@ function open_command() {
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
$open_cmd "$@" &>/dev/null
${=open_cmd} "$@" &>/dev/null
else
nohup $open_cmd "$@" &>/dev/null
nohup ${=open_cmd} "$@" &>/dev/null
fi
}
@ -54,8 +51,7 @@ function open_command() {
# 1 if it does not exist
#
function alias_value() {
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
test $(alias "$1")
(( $+aliases[$1] )) && echo $aliases[$1]
}
#

View File

@ -185,7 +185,7 @@ function git_prompt_status() {
# 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
local INPUT_GIT_VERSION INSTALLED_GIT_VERSION i
INPUT_GIT_VERSION=(${(s/./)1})
INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})

View File

@ -1,7 +1,6 @@
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
local clear list
zparseopts -E c=clear l=list
if [[ -n "$clear" ]]; then
@ -12,9 +11,8 @@ function omz_history {
# if -l provided, run as if calling `fc' directly
builtin fc "$@"
else
# otherwise, call `fc -l 1` to show all available
# history (and pass additional parameters)
builtin fc "$@" -l 1
# unless a number is provided, show all history events (starting from 1)
[[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
fi
}
@ -23,7 +21,8 @@ case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
"") alias history='omz_history' ;;
*) alias history="omz_history -t '$HIST_STAMPS'" ;;
esac
## History file configuration

View File

@ -18,9 +18,8 @@ fi
## jobs
setopt long_list_jobs
## pager
env_default PAGER 'less'
env_default LESS '-R'
env_default 'PAGER' 'less'
env_default 'LESS' '-R'
## super user alias
alias _='sudo'

View File

@ -12,7 +12,7 @@
# 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 {
virtualenv_prompt_info jenv_prompt_info {
return 1
}

View File

@ -1,7 +1,7 @@
#! /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/
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG

View File

@ -80,7 +80,7 @@ preexec_functions+=(omz_termsupport_preexec)
# Keep Apple Terminal.app's current working directory updated
# Based on this answer: http://superuser.com/a/315029
# Based on this answer: https://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

View File

@ -1,6 +1,17 @@
# 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
# Migrate .zsh-update file to $ZSH_CACHE_DIR
if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then
mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update
fi
# 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
env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
@ -17,12 +28,6 @@ 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

View File

@ -48,8 +48,8 @@ _arguments \
case "$state" in
specify_device)
_values 'devices' $(adb devices -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \
{printf "%s[%s] ",$1,$6 }')
_values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \
{sub(/ +/," ",$0);gsub(":","\\:",$1); printf "%s[%s] ",$1, $NF}'):-""}
return
;;
esac

View File

@ -2,6 +2,26 @@
## Features
#### YAY
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
| yaconf | yay -Pg | Print current configuration |
| yain | yay -S | Install packages from the repositories |
| yains | yay -U | Install a package from a local file |
| yainsd | yay -S --asdeps | Install packages as dependencies of another package |
| yaloc | yay -Qi | Display information about a package in the local database |
| yalocs | yay -Qs | Search for packages in the local database |
| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") |
| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist |
| yaorph | yay -Qtd | Remove orphans using yaourt |
| yare | yay -R | Remove packages, keeping its settings and dependencies |
| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies |
| yarep | yay -Si | Display information about a package in the repositories |
| yareps | yay -Ss | Search for packages in the repositories |
| yaupg | yay -Syu | Sync with repositories before upgrading packages |
| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation |
#### TRIZEN
| Alias | Command | Description |
@ -23,7 +43,7 @@
| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
| trupd | trizen -Sy | Update and refresh the local package database |
| trupd | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| trupg | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
| upgrade | trizen -Syu | Sync with repositories before upgrading packages |

View File

@ -56,6 +56,35 @@ if (( $+commands[yaourt] )); then
fi
fi
if (( $+commands[yay] )); then
alias yaconf='yay -Pg'
alias yaupg='yay -Syu'
alias yasu='yay -Syu --noconfirm'
alias yain='yay -S'
alias yains='yay -U'
alias yare='yay -R'
alias yarem='yay -Rns'
alias yarep='yay -Si'
alias yareps='yay -Ss'
alias yaloc='yay -Qi'
alias yalocs='yay -Qs'
alias yalst='yay -Qe'
alias yaorph='yay -Qtd'
alias yainsd='yay -S --asdeps'
alias yamir='yay -Syy'
if (( $+commands[abs] && $+commands[aur] )); then
alias yaupd='yay -Sy && sudo abs && sudo aur'
elif (( $+commands[abs] )); then
alias yaupd='yay -Sy && sudo abs'
elif (( $+commands[aur] )); then
alias yaupd='yay -Sy && sudo aur'
else
alias yaupd='yay -Sy'
fi
fi
if (( $+commands[pacaur] )); then
alias paupg='pacaur -Syu'
alias pasu='pacaur -Syu --noconfirm'
@ -95,6 +124,10 @@ elif (( $+commands[yaourt] )); then
function upgrade() {
yaourt -Syu
}
elif (( $+commands[yay] )); then
function upgrade() {
yay -Syu
}
else
function upgrade() {
sudo pacman -Syu

View File

@ -1,12 +1,17 @@
# Find where asdf should be installed.
# 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
# If not found, check for Homebrew package
if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then
ASDF_DIR="$(brew --prefix asdf)"
fi
# Load asdf completions, if found.
if [ -f $ASDF_DIR/completions/asdf.bash ]; then
. $ASDF_DIR/completions/asdf.bash
# Load command
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
. "$ASDF_DIR/asdf.sh"
# Load completions
if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then
. "$ASDF_DIR/completions/asdf.bash"
fi
fi

View File

@ -0,0 +1,11 @@
# Autojump plugin
This plugin loads the [autojump navigation tool](https://github.com/wting/autojump).
To use it, add `autojump` to the plugins array in your zshrc file:
```zsh
plugins=(... autojump)
```
More info on the usage: https://github.com/wting/autojump

View File

@ -15,8 +15,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /etc/profile.d/autojump.sh
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
. /usr/local/share/autojump/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.sh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.sh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew
. `brew --prefix`/etc/autojump.sh
fi

View File

@ -0,0 +1,8 @@
# autopep8 plugin
This plugin adds completion for [autopep8](https://pypi.org/project/autopep8/), a tool that automatically formats Python code to conform to the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide.
To use it, add autopep8 to the plugins array of your zshrc file:
```
plugins=(... autopep8)
```

13
plugins/battery/README.md Normal file
View File

@ -0,0 +1,13 @@
# Battery Plugin
This plugin adds some functions you can use to display battery information in your custom theme.
To use, add `battery` to the list of plugins in your `.zshrc` file:
`plugins=(... battery)`
Then, add the `battery_pct_prompt` function to your custom theme. For example:
```
RPROMPT='$(battery_pct_prompt)'
```

View File

@ -1,11 +1,11 @@
## bbedit
Plugin for BBEdit, an HTML and text editor for Mac OS X
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)
* [BBEdit](https://www.barebones.com/products/bbedit/)
* [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html)
### Usage

View File

@ -13,7 +13,7 @@ Just add bgnotify to your plugins list in your `.zshrc`
- On OS X you'll need [terminal-notifier](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
- On windows you can use [notifu](https://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
## Screenshots

2
plugins/bgnotify/bgnotify.plugin.zsh Executable file → Normal file
View File

@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle)
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
kdialog --title "$1" --passivepopup "$2" 5
elif hash notifu 2>/dev/null; then #cygwyn support!
notifu /m "$2" /p "$1"
fi

18
plugins/bower/README.md Normal file
View File

@ -0,0 +1,18 @@
# Bower plugin
This plugin adds completion for [Bower](https://bower.io/) and a few useful aliases for common Bower commands.
To use it, add `bower` to the plugins array in your zshrc file:
```
plugins=(... bower)
```
## Aliases
| Alias | Command | Description |
|-------|-----------------|--------------------------------------------------------|
| bi | `bower install` | Installs the project dependencies listed in bower.json |
| bl | `bower list` | List local packages and possible updates |
| bs | `bower search` | Finds all packages or a specific package. |

19
plugins/brew/README.md Normal file
View File

@ -0,0 +1,19 @@
# brew plugin
The plugin adds several aliases for common [brew](https://brew.sh) commands.
To use it, add `brew` to the plugins array of your zshrc file:
```
plugins=(... brew)
```
## Aliases
| Alias | Command | Description |
|--------|----------------------|---------------|
| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. |
| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |

View File

@ -1,4 +1,6 @@
alias brewp='brew pin'
alias brews='brew list -1'
alias brewsp='brew list --pinned'
alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'

View File

@ -2,7 +2,8 @@
- adds completion for basic bundler commands
- adds short aliases for common bundler commands
- `be` aliased to `bundle exec`
- `be` aliased to `bundle exec`.
It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`).
- `bl` aliased to `bundle list`
- `bp` aliased to `bundle package`
- `bo` aliased to `bundle open`
@ -13,7 +14,8 @@
- 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.
Common gems wrapped by default (by name of the executable):
`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`.
## Configuration

View File

@ -54,10 +54,14 @@ done
## Functions
bundle_install() {
if _bundler-installed && _within-bundled-project; then
if ! _bundler-installed; then
echo "Bundler is not installed"
elif ! _within-bundled-project; then
echo "Can't 'bundle install' outside a bundled project"
else
local bundler_version=`bundle version | cut -d' ' -f3`
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
if [[ "$OSTYPE" = darwin* ]]
if [[ "$OSTYPE" = (darwin|freebsd)* ]]
then
local cores_num="$(sysctl -n hw.ncpu)"
else
@ -67,8 +71,6 @@ bundle_install() {
else
bundle install $@
fi
else
echo "Can't 'bundle install' outside a bundled project"
fi
}

View File

@ -1,5 +1,5 @@
#
# Requires http://www.bruji.com/bwana/
# Requires https://www.bruji.com/bwana/
#
if [[ -e /Applications/Bwana.app ]] ||
( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
@ -9,5 +9,5 @@ then
}
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/"
echo "To use it within Zsh, install it from https://www.bruji.com/bwana/"
fi

35
plugins/catimg/README.md Normal file
View File

@ -0,0 +1,35 @@
# catimg
Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg)
## Requirements
- `convert` (ImageMagick)
## Enabling the plugin
1. Open your `.zshrc` file and add `catimg` in the plugins section:
```zsh
plugins=(
# all your enabled plugins
catimg
)
```
2. Reload the source file or restart your Terminal session:
```console
$ source ~/.zshrc
$
```
## Functions
| Function | Description |
| -------- | ---------------------------------------- |
| `catimg` | Displays the given image on the terminal |
## Usage examples
[![asciicast](https://asciinema.org/a/204702.png)](https://asciinema.org/a/204702)

View File

@ -1,6 +1,6 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# http://posva.net #
# https://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #

2
plugins/catimg/catimg.sh Executable file → Normal file
View File

@ -1,6 +1,6 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# http://posva.net #
# https://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #

View File

@ -111,5 +111,11 @@ function chruby_prompt_info() {
}
# complete on installed rubies
_chruby() { compadd $(chruby | tr -d '* ') }
_chruby() {
compadd $(chruby | tr -d '* ')
local default_path='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
if PATH=${default_path} type ruby &> /dev/null; then
compadd system
fi
}
compdef _chruby chruby

View File

@ -0,0 +1,20 @@
# chucknorris
Chuck Norris fortunes plugin for oh-my-zsh
**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff)
To use it add `chucknorris` to the plugins array in you zshrc file.
```zsh
plugins=(... chucknorris)
```
Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD.
| Command | Description |
| ----------- | ------------------------------- |
| `chuck` | Print random Chuck Norris quote |
| `chuck_cow` | Print quote in cowthink |

View File

@ -0,0 +1,58 @@
# Cloudfoundry Plugin
This plugin is intended to offer a few simple aliases for regular users of the [Cloud Foundry Cli][1]. Most are just simple aliases that will save a bit of typing. Others include mini functions and or accept parameters. Take a look at the table below for details.
| Alias | Command | Description |
|----------|-----------------------------|--------------------------------------------------------------------------|
| cfl | `cf login` | Login to Cloud Foundry |
| cft | `cf target` | Target the cli at a specific Org/Space in Cloud Foundry |
| cfa | `cf apps` | List all applications in the current Org/Space |
| cfs | `cf services` | List all services in the current Org/Space |
| cfm | `cf marketplace` | List the services available in the Marketplace |
| cfp | `cf push` | Push your application code to Cloud Foundry |
| cfcs | `cf create-service` | Create a service based on a Marketplace offering |
| cfbs | `cf bind-service` | Bind an application to a service you created |
| cfus | `cf unbind-service` | Unbind a service from an application |
| cfds | `cf delete-service` | Delete a service you no longer have bound |
| cfup | `cf cups` | Create a "user-provided-service" |
| cflg | `cf logs` | Tail the logs of an application (requires <APP_NAME>) |
| cfr | `cf routes` | List all the routes in the current Space |
| cfe | `cf env` | Show the environment variables for an application (requires <APP_NAME>) |
| cfsh | `cf ssh` | Attach to a running container (requires an <APP_NAME> etc.) |
| cfsc | `cf scale` | Scale an application (requires an <APP_NAME> etc.) |
| cfev | `cf events` | Show the application events (requires <APP_NAME>) |
| cfdor | `cf delete-orphaned-routes` | Delete routes that are no longer bound to applications |
| cfbpk | `cf buildpacks` | List the available buildpacks |
| cfdm | `cf domains` | List the domains associates with this Cloud Foundry foundation |
| cfsp | `cf spaces` | List all the Spaces in the current Org |
| cfap | `cf app` | Show the details of a deployed application (requires <APP_NAME>) |
| cfh. | `export CF_HOME=$PWD/.cf` | Set the current directory as CF_HOME |
| cfh~ | `export CF_HOME=~/.cf` | Set the user's root directory as CF_HOME |
| cfhu | `unset CF_HOME` | Unsets CF_HOME |
| cfpm | `cf push -f` | Push an application using a manifest (requires <MANIFEST_FILE> location) |
| cflr | `cf logs --recent` | Show the recent logs (requires <APP_NAME>) |
| cfsrt | `cf start` | Start an application (requires <APP_NAME>) |
| cfstp | `cf stop` | Stop an application (requires <APP_NAME>) |
| cfstg | `cf restage` | Restage an application (requires <APP_NAME>) |
| cfdel | `cf delete` | Delete an application (requires <APP_NAME>) |
| cfsrtall | - | Start all apps that are currently in the "Stopped" state |
| cfstpall | - | Stop all apps that are currently in the "Started" state |
For help and advice on what any of the commands does, consult the built in `cf` help functions as follows:-
```bash
cf help # List the most popular and commonly used commands
cf help -a # Complete list of all possible commands
cf <COMMAND_NAME> --help # Help on a specific command including arguments and examples
```
Alternatively, seek out the [online documentation][3]. And don't forget, there are loads of great [community plugins for the cf-cli][4] command line tool that can greatly extend its power and usefulness.
## Contributors
Contributed to `oh_my_zsh` by [benwilcock][2].
[1]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
[2]: https://github.com/benwilcock
[3]: https://docs.cloudfoundry.org/cf-cli/getting-started.html
[4]: https://plugins.cloudfoundry.org/

View File

@ -0,0 +1,34 @@
# Some Useful CloudFoundry Aliases & Functions
alias cfl="cf login"
alias cft="cf target"
alias cfa="cf apps"
alias cfs="cf services"
alias cfm="cf marketplace"
alias cfp="cf push"
alias cfcs="cf create-service"
alias cfbs="cf bind-service"
alias cfus="cf unbind-service"
alias cfds="cf delete-service"
alias cfup="cf cups"
alias cflg="cf logs"
alias cfr="cf routes"
alias cfe="cf env"
alias cfsh="cf ssh"
alias cfsc="cf scale"
alias cfev="cf events"
alias cfdor="cf delete-orphaned-routes"
alias cfbpk="cf buildpacks"
alias cfdm="cf domains"
alias cfsp="cf spaces"
function cfap() { cf app $1 }
function cfh.() { export CF_HOME=$PWD/.cf }
function cfh~() { export CF_HOME=~/.cf }
function cfhu() { unset CF_HOME }
function cfpm() { cf push -f $1 }
function cflr() { cf logs $1 --recent }
function cfsrt() { cf start $1 }
function cfstp() { cf stop $1 }
function cfstg() { cf restage $1 }
function cfdel() { cf delete $1 }
function cfsrtall() {cf apps | awk '/stopped/ { system("cf start " $1)}'}
function cfstpall() {cf apps | awk '/started/ { system("cf stop " $1)}'}

View File

@ -1,6 +1,6 @@
#compdef coffee
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
# Completion script for Coffee.js v0.6.11 (https://coffeescript.org)
#
# ------------------------------------------------------------------------------
# Authors

View File

@ -0,0 +1,18 @@
# colorize
With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats.
To use it, add colorize to the plugins array of your zshrc file:
```
plugins=(... colorize)
```
## Usage
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). If no arguments are passed it will colorize the standard input or stdin.
Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting method for a given extension, it will try to find one by looking at the file contents. If no highlight method is found it will just cat the file normally, without syntax highlighting.
## Requirements
You have to install Pygments first: [pygments.org](http://pygments.org/download/)

View File

@ -1,27 +1,26 @@
# 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.
#easier alias to use plugin
# easier alias to use the plugin
alias ccat='colorize_via_pygmentize'
colorize_via_pygmentize() {
if [ ! -x "$(which pygmentize)" ]; then
echo "package \'Pygments\' is not installed!"
return -1
if ! (( $+commands[pygmentize] )); then
echo "package 'Pygments' is not installed!"
return 1
fi
# pygmentize stdin if no arguments passed
if [ $# -eq 0 ]; then
pygmentize -g $@
pygmentize -g
return $?
fi
# guess lexer from file extension, or
# guess it from file contents if unsuccessful
local FNAME lexer
for FNAME in $@
do
filename=$(basename "$FNAME")
lexer=`pygmentize -N \"$filename\"`
if [ "Z$lexer" != "Ztext" ]; then
pygmentize -l $lexer "$FNAME"
lexer=$(pygmentize -N "$FNAME")
if [[ $lexer != text ]]; then
pygmentize -l "$lexer" "$FNAME"
else
pygmentize -g "$FNAME"
fi

View File

@ -0,0 +1,31 @@
# command-not-found plugin
This plugin uses the command-not-found package for zsh to provide suggested packages to be installed if a command cannot be found.
To use it, add `command-not-found` to the plugins array of your zshrc file:
```zsh
plugins=(... command-not-found)
```
An example of how this plugin works in Ubuntu:
```
$ mutt
The program 'mutt' can be found in the following packages:
* mutt
* mutt-kz
* mutt-patched
Try: sudo apt install <selected package>
```
### Supported platforms
It works out of the box with the command-not-found packages for:
- [Ubuntu](https://www.porcheron.info/command-not-found-for-zsh/)
- [Debian](https://packages.debian.org/search?keywords=command-not-found)
- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found)
- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found)
- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound)
You can add support for other platforms by submitting a Pull Request.

View File

@ -1,5 +1,5 @@
# Uses the command-not-found package zsh support
# as seen in http://www.porcheron.info/command-not-found-for-zsh/
# as seen in https://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

View File

@ -13,7 +13,7 @@ alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'
alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file
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} '
@ -44,8 +44,6 @@ 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'

View File

@ -0,0 +1,29 @@
# composer
This plugin provides completion for [composer](https://getcomposer.org/), as well as aliases
for frequent composer commands. It also adds Composer's global binaries to the PATH, using
Composer if available.
To use it add `composer` to the plugins array in your zshrc file.
```zsh
plugins=(... composer)
```
## Aliases
| Alias | Command | Description |
| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- |
| `c` | composer | Starts composer |
| `csu` | composer self-update | Updates composer to the latest version |
| `cu` | composer update | Updates composer dependencies and `composer.lock` file |
| `cr` | composer require | Adds new packages to `composer.json` |
| `crm` | composer remove | Removes packages from `composer.json` |
| `ci` | composer install | Resolves and installs dependencies from `composer.json` |
| `ccp` | composer create-project | Create new project from an existing package |
| `cdu` | composer dump-autoload | Updates the autoloader |
| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) |
| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory |
| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory |
| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory |
| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory |

View File

@ -51,5 +51,10 @@ 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)
# Add Composer's global binaries to PATH, using Composer if available.
if (( $+commands[composer] )); then
export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null)
else
[ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin
[ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin
fi

View File

@ -0,0 +1,86 @@
# Usage: dash [keyword:]query
dash() { open dash://"$*" }
compdef _dash dash
_dash() {
# No sense doing this for anything except the 2nd position and if we haven't
# specified which docset to query against
if [[ $CURRENT -eq 2 && ! "$words[2]" =~ ":" ]]; then
local -a _all_docsets
_all_docsets=()
# Use defaults to get the array of docsets from preferences
# Have to smash it into one big line so that each docset is an element of
# our DOCSETS array
DOCSETS=("${(@f)$(defaults read com.kapeli.dashdoc docsets | tr -d '\n' | grep -oE '\{.*?\}')}")
# remove all newlines since defaults prints so pretty like
# Now get each docset and output each on their own line
for doc in "$DOCSETS[@]"; do
# Only output docsets that are actually enabled
if [[ "`echo $doc | grep -Eo \"isEnabled = .*?;\" | sed 's/[^01]//g'`" == "0" ]]; then
continue
fi
keyword=''
# Order of preference as explained to me by @kapeli via email
KEYWORD_LOCATORS=(keyword suggestedKeyword platform)
for locator in "$KEYWORD_LOCATORS[@]"; do
# Echo the docset, try to find the appropriate keyword
# Strip doublequotes and colon from any keyword so that everything has the
# same format when output (we'll add the colon in the completion)
keyword=`echo $doc | grep -Eo "$locator = .*?;" | sed -e "s/$locator = \(.*\);/\1/" -e "s/[\":]//g"`
if [[ ! -z "$keyword" ]]; then
# if we fall back to platform, we should do some checking per @kapeli
if [[ "$locator" == "platform" ]]; then
# Since these are the only special cases right now, let's not do the
# expensive processing unless we have to
if [[ "$keyword" == "python" || "$keyword" == "java" || \
"$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then
docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"`
if [[ "$keyword" == "python" ]]; then
if [[ "$docsetName" == "Python 2" ]]; then
keyword="python2"
elif [[ "$docsetName" == "Python 3" ]]; then
keyword="python3"
fi
elif [[ "$keyword" == "java" ]]; then
if [[ "$docsetName" == "Java SE7" ]]; then
keyword="java7"
elif [[ "$docsetName" == "Java SE6" ]]; then
keyword="java6"
elif [[ "$docsetName" == "Java SE8" ]]; then
keyword="java8"
fi
elif [[ "$keyword" == "qt" ]]; then
if [[ "$docsetName" == "Qt 5" ]]; then
keyword="qt5"
elif [[ "$docsetName" == "Qt 4" ]]; then
keyword="qt4"
elif [[ "$docsetName" == "Qt" ]]; then
keyword="qt4"
fi
elif [[ "$keyword" == "cocos2d" ]]; then
if [[ "$docsetName" == "Cocos3D" ]]; then
keyword="cocos3d"
fi
fi
fi
fi
# Bail once we have a match
break
fi
done
# If we have a keyword, add it to the list!
if [[ ! -z "$keyword" ]]; then
_all_docsets+=($keyword)
fi
done
# special thanks to [arx] on #zsh for getting me sorted on this piece
compadd -qS: -- "$_all_docsets[@]"
return
fi
}

View File

@ -5,9 +5,12 @@
#
# Debian-related zsh aliases and functions for zsh
# Use aptitude if installed, or apt-get if not.
# Use apt or aptitude if installed, fallback is apt-get
# You can just set apt_pref='apt-get' to override it.
if [[ -e $( which -p aptitude 2>&1 ) ]]; then
if [[ -e $( which -p apt 2>&1 ) ]]; then
apt_pref='apt'
apt_upgr='upgrade'
elif [[ -e $( which -p aptitude 2>&1 ) ]]; then
apt_pref='aptitude'
apt_upgr='safe-upgrade'
else
@ -176,7 +179,7 @@ apt-copy() {
# apt-history remove
# apt-history rollback
# apt-history list
# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
# Based On: https://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
apt-history () {
case "$1" in
install)

View File

@ -0,0 +1,78 @@
# dircycle
Plugin for cycling through the directory stack
This plugin enables directory navigation similar to using back and forward on browsers or common file explorers like Finder or Nautilus. It uses a small zle trick that lets you cycle through your directory stack left or right using <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> . This is useful when moving back and forth between directories in development environments, and can be thought of as kind of a nondestructive pushd/popd.
## Enabling the plugin
1. Open your `.zshrc` file and add `dircycle` in the plugins section:
```zsh
plugins=(
# all your enabled plugins
dircycle
)
```
2. Reload the source file or restart your Terminal session:
```console
$ source ~/.zshrc
$
```
## Usage Examples
Say you opened these directories on the terminal:
```console
~$ cd Projects
~/Projects$ cd Hacktoberfest
~/Projects/Hacktoberfest$ cd oh-my-zsh
~/Projects/Hacktoberfest/oh-my-zsh$ dirs -v
0 ~/Projects/Hacktoberfest/oh-my-zsh
1 ~/Projects/Hacktoberfest
2 ~/Projects
3 ~
```
By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
Here's a example history table with the same accessed directories like above:
| Current `$CWD` | Key press | New `$CWD` |
| --------------- | ----------------------------------------------------- | --------------- |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Hacktoberfest` |
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Projects` |
| `Projects` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `~` |
| `~` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `Projects` |
| `Projects` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `Hacktoberfest` |
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `oh-my-zsh` |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `~` |
Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`.
Here's an asciinema cast demonstrating the example above:
[![asciicast](https://asciinema.org/a/204406.png)](https://asciinema.org/a/204406)
## Functions
| Function | Description |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
| `insert-cycledright` | Change `$CWD` to the next known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
## Rebinding keys
You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> in `xterm-256color`:
```zsh
bindkey '^[[1;4D' insert-cycledleft
bindkey '^[[1;4C' insert-cycledright
```
You can get the bindkey sequence by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>, then pressing the keyboard shortcut you want to use.

View File

@ -9,31 +9,36 @@
# pushd -N: start counting from right of `dirs' output
switch-to-dir () {
[[ ${#dirstack} -eq 0 ]] && return
setopt localoptions nopushdminus
[[ ${#dirstack} -eq 0 ]] && return 1
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
[[ ${#dirstack} -eq 0 ]] && return 1
done
}
insert-cycledleft () {
emulate -L zsh
setopt nopushdminus
switch-to-dir +1 || return
switch-to-dir +1
local fn
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
}
zle -N insert-cycledleft
insert-cycledright () {
emulate -L zsh
setopt nopushdminus
switch-to-dir -0 || return
switch-to-dir -0
local fn
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
}
zle -N insert-cycledright

View File

@ -0,0 +1,17 @@
# Dirhistory plugin
This plugin adds keyboard shortcuts for navigating directory history and hierarchy.
To use it, add `dirhistory` to the plugins array in your zshrc file:
```zsh
plugins=(... dirhistory)
```
## Keyboard Shortcuts
| Shortcut | Description |
|-----------------------------------|-----------------------------------------------------------|
| <kbd>alt</kbd> + <kbd>left</kbd> | Go to previous directory |
| <kbd>alt</kbd> + <kbd>right</kbd> | Undo <kbd>alt</kbd> + <kbd>left</kbd> |
| <kbd>alt</kbd> + <kbd>up</kbd> | Move into the parent directory |
| <kbd>alt</kbd> + <kbd>down</kbd> | Move into the first child directory by alphabetical order |

View File

@ -0,0 +1,9 @@
# Dirpersist plugin
This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file.
To use it, add `dirpersist` to the plugins array in your zshrc file:
```zsh
plugins=(... dirpersist)
```

56
plugins/django/README.md Normal file
View File

@ -0,0 +1,56 @@
# Django plugin
This plugin adds completion and hints for the [Django Project](https://www.djangoproject.com/) `manage.py` commands
and options.
To use it, add `django` to the plugins array in your zshrc file:
```zsh
plugins=(... django)
```
## Usage
```zsh
$> python manage.py (press <TAB> here)
```
Would result in:
```zsh
cleanup -- remove old data from the database
compilemessages -- compile .po files to .mo for use with gettext
createcachetable -- creates table for SQL cache backend
createsuperuser -- create a superuser
dbshell -- run command-line client for the current database
diffsettings -- display differences between the current settings and Django defaults
dumpdata -- output contents of database as a fixture
flush -- execute 'sqlflush' on the current database
inspectdb -- output Django model module for tables in database
loaddata -- install the named fixture(s) in the database
makemessages -- pull out all strings marked for translation
reset -- executes 'sqlreset' for the given app(s)
runfcgi -- run this project as a fastcgi
runserver -- start a lightweight web server for development
...
```
If you want to see the options available for a specific command, try:
```zsh
$> python manage.py makemessages (press <TAB> here)
```
And that would result in:
```zsh
--all -a -- re-examine all code and templates
--domain -d -- domain of the message files (default: "django")
--extensions -e -- file extension(s) to examine (default: ".html")
--help -- display help information
--locale -l -- locale to process (default: all)
--pythonpath -- directory to add to the Python path
--settings -- python path to settings module
...
```

0
plugins/dnf/README.md Executable file → Normal file
View File

View File

@ -1,4 +1,29 @@
# Docker-compose plugin for oh my zsh
# Docker-compose
A copy of the completion script from the [docker-compose](https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose) git repo.
This plugin provides completion for [docker-compose](https://docs.docker.com/compose/) as well as some
aliases for frequent docker-compose commands.
To use it, add docker-compose to the plugins array of your zshrc file:
```
plugins=(... docker-compose)
```
## Aliases
| Alias | Command | Description |
|-----------|--------------------------|------------------------------------------------------------------|
| dco | `docker-compose` | Docker-compose main command |
| dcb | `docker-compose build` | Build containers |
| dce | `docker-compose exec` | Execute command inside a container |
| dcps | `docker-compose ps` | List containers |
| dcrestart | `docker-compose restart` | Restart container |
| dcrm | `docker-compose rm` | Remove container |
| dcr | `docker-compose run` | Run a command in container |
| dcstop | `docker-compose stop` | Stop a container |
| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service |
| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon |
| dcdn | `docker-compose down` | Stop and remove containers |
| dcl | `docker-compose logs` | Show logs of container |
| dclf | `docker-compose logs -f` | Show logs and follow output |
| dcpull | `docker-compose pull` | Pull image of a service |
| dcstart | `docker-compose start` | Start a container |

View File

@ -18,6 +18,7 @@ alias dcrm='docker-compose rm'
alias dcr='docker-compose run'
alias dcstop='docker-compose stop'
alias dcup='docker-compose up'
alias dcupd='docker-compose up -d'
alias dcdn='docker-compose down'
alias dcl='docker-compose logs'
alias dclf='docker-compose logs -f'

View File

@ -0,0 +1,359 @@
#compdef docker-machine
# Description
# -----------
# zsh completion for docker-machine
# https://github.com/leonhartX/docker-machine-zsh-completion
# -------------------------------------------------------------------------
# Version
# -------
# 0.1.1
# -------------------------------------------------------------------------
# Authors
# -------
# * Ke Xu <leonhartx.k@gmail.com>
# -------------------------------------------------------------------------
# Inspiration
# -----------
# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion
# * @ilkka _docker-machine
__docker-machine_get_hosts() {
[[ $PREFIX = -* ]] && return 1
local state
declare -a hosts
state=$1; shift
if [[ $state != all ]]; then
hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"})
else
hosts=(${(f)"$(_call_program commands docker-machine ls -q)"})
fi
_describe 'host' hosts "$@" && ret=0
return ret
}
__docker-machine_hosts_with_state() {
declare -a hosts
hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"})
_describe 'host' hosts
}
__docker-machine_hosts_all() {
__docker-machine_get_hosts all "$@"
}
__docker-machine_hosts_running() {
__docker-machine_get_hosts Running "$@"
}
__docker-machine_get_swarm() {
declare -a swarms
swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"})
_describe 'swarm' swarms
}
__docker-machine_hosts_and_files() {
_alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files'
}
__docker-machine_filters() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(driver)
_describe -t driver-filter-opts "driver filter" opts_driver && ret=0
;;
(swarm)
__docker-machine_get_swarm && ret=0
;;
(state)
opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error')
_describe -t state-filter-opts "state filter" opts_state && ret=0
;;
(name)
__docker-machine_hosts_all && ret=0
;;
(label)
_message 'label' && ret=0
;;
*)
_message 'value' && ret=0
;;
esac
else
opts=('driver' 'swarm' 'state' 'name' 'label')
_describe -t filter-opts "filter" opts -qS "=" && ret=0
fi
return ret
}
__get_swarm_discovery() {
declare -a masters serivces
local service
services=()
masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}'))
for master in $masters; do
service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}}
services=($services $service)
done
_describe -t services "swarm service" services && ret=0
return ret
}
__get_create_argument() {
typeset -g docker_machine_driver
if [[ CURRENT -le 2 ]]; then
docker_machine_driver="none"
elif [[ CURRENT > 2 && $words[CURRENT-2] = '-d' || $words[CURRENT-2] = '--driver' ]]; then
docker_machine_driver=$words[CURRENT-1]
elif [[ $words[CURRENT-1] =~ '^(-d|--driver)=' ]]; then
docker_machine_driver=${${words[CURRENT-1]}/*=/}
fi
local driver_opt_cmd
local -a opts_provider opts_common opts_read_argument
opts_read_argument=(
": :->argument"
)
opts_common=(
$opts_help \
'(--driver -d)'{--driver=,-d=}'[Driver to create machine with]:dirver:->driver-option' \
'--engine-install-url=[Custom URL to use for engine installation]:url' \
'*--engine-opt=[Specify arbitrary flags to include with the created engine in the form flag=value]:flag' \
'*--engine-insecure-registry=[Specify insecure registries to allow with the created engine]:registry' \
'*--engine-registry-mirror=[Specify registry mirrors to use]:mirror' \
'*--engine-label=[Specify labels for the created engine]:label' \
'--engine-storage-driver=[Specify a storage driver to use with the engine]:storage-driver:->storage-driver-option' \
'*--engine-env=[Specify environment variables to set in the engine]:environment' \
'--swarm[Configure Machine with Swarm]' \
'--swarm-image=[Specify Docker image to use for Swarm]:image' \
'--swarm-master[Configure Machine to be a Swarm master]' \
'--swarm-discovery=[Discovery service to use with Swarm]:service:->swarm-service' \
'--swarm-strategy=[Define a default scheduling strategy for Swarm]:strategy:(spread binpack random)' \
'*--swarm-opt=[Define arbitrary flags for swarm]:flag' \
'*--swarm-join-opt=[Define arbitrary flags for Swarm join]:flag' \
'--swarm-host=[ip/socket to listen on for Swarm master]:host' \
'--swarm-addr=[addr to advertise for Swarm (default: detect and use the machine IP)]:address' \
'--swarm-experimental[Enable Swarm experimental features]' \
'*--tls-san=[Support extra SANs for TLS certs]:option'
)
driver_opt_cmd="docker-machine create -d $docker_machine_driver | grep $docker_machine_driver | sed -e 's/\(--.*\)\ *\[\1[^]]*\]/*\1/g' -e 's/\(\[[^]]*\)/\\\\\\1\\\\/g' -e 's/\".*\"\(.*\)/\1/g' | awk '{printf \"%s[\", \$1; for(i=2;i<=NF;i++) {printf \"%s \", \$i}; print \"]\"}'"
if [[ $docker_machine_driver != "none" ]]; then
opts_provider=(${(f)"$(_call_program commands $driver_opt_cmd)"})
_arguments \
$opts_provider \
$opts_read_argument \
$opts_common && ret=0
else
_arguments $opts_common && ret=0
fi
case $state in
(driver-option)
_describe -t driver-option "driver" opts_driver && ret=0
;;
(storage-driver-option)
_describe -t storage-driver-option "storage driver" opts_storage_driver && ret=0
;;
(swarm-service)
__get_swarm_discovery && ret=0
;;
(argument)
ret=0
;;
esac
return ret
}
__docker-machine_subcommand() {
local -a opts_help
opts_help=("(- :)--help[Print usage]")
local -a opts_only_host opts_driver opts_storage_driver opts_stragery
opts_only_host=(
"$opts_help"
"*:host:__docker-machine_hosts_all"
)
opts_driver=('amazonec2' 'azure' 'digitalocean' 'exoscale' 'generic' 'google' 'hyperv' 'none' 'openstack' 'rackspace' 'softlayer' 'virtualbox' 'vmwarefusion' 'vmwarevcloudair' 'vmwarevsphere')
opts_storage_driver=('overlay' 'aufs' 'btrfs' 'devicemapper' 'vfs' 'zfs')
integer ret=1
case "$words[1]" in
(active)
_arguments \
$opts_help \
'(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' && ret=0
;;
(config)
_arguments \
$opts_help \
'--swarm[Display the Swarm config instead of the Docker daemon]' \
"*:host:__docker-machine_hosts_all" && ret=0
;;
(create)
__get_create_argument
;;
(env)
_arguments \
$opts_help \
'--swarm[Display the Swarm config instead of the Docker daemon]' \
'--shell=[Force environment to be configured for a specified shell: \[fish, cmd, powershell\], default is auto-detect]:shell' \
'(--unset -u)'{--unset,-u}'[Unset variables instead of setting them]' \
'--no-proxy[Add machine IP to NO_PROXY environment variable]' \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(help)
_arguments ':subcommand:__docker-machine_commands' && ret=0
;;
(inspect)
_arguments \
$opts_help \
'(--format -f)'{--format=,-f=}'[Format the output using the given go template]:template' \
'*:host:__docker-machine_hosts_all' && ret=0
;;
(ip)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(kill)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(ls)
_arguments \
$opts_help \
'(--quiet -q)'{--quiet,-q}'[Enable quiet mode]' \
'*--filter=[Filter output based on conditions provided]:filter:->filter-options' \
'(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' \
'(--format -f)'{--format=,-f=}'[Pretty-print machines using a Go template]:template' && ret=0
case $state in
(filter-options)
__docker-machine_filters && ret=0
;;
esac
;;
(provision)
_arguments $opts_only_host && ret=0
;;
(regenerate-certs)
_arguments \
$opts_help \
'(--force -f)'{--force,-f}'[Force rebuild and do not prompt]' \
'*:host:__docker-machine_hosts_all' && ret=0
;;
(restart)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(rm)
_arguments \
$opts_help \
'(--force -f)'{--force,-f}'[Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)]' \
'-y[Assumes automatic yes to proceed with remove, without prompting further user confirmation]' \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(scp)
_arguments \
$opts_help \
'(--recursive -r)'{--recursive,-r}'[Copy files recursively (required to copy directories))]' \
'*:files:__docker-machine_hosts_and_files' && ret=0
;;
(ssh)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(start)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(status)
_arguments $opts_only_host && ret=0
;;
(stop)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(upgrade)
_arguments $opts_only_host && ret=0
;;
(url)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
esac
return ret
}
__docker-machine_commands() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker-machine_caching_policy
fi
if ( [[ ${+_docker_machine_subcommands} -eq 0 ]] || _cache_invalid docker_machine_subcommands) \
&& ! _retrieve_cache docker_machine_subcommands;
then
local -a lines
lines=(${(f)"$(_call_program commands docker-machine 2>&1)"})
_docker_machine_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/$'\t'##/:})
(( $#_docker_machine_subcommands > 0 )) && _store_cache docker_machine_subcommands _docker_machine_subcommands
fi
_describe -t docker-machine-commands "docker-machine command" _docker_machine_subcommands
}
__docker-machine_caching_policy() {
oldp=( "$1"(Nmh+1) )
(( $#oldp ))
}
_docker-machine() {
if [[ $service != docker-machine ]]; then
_call_function - _$service
return
fi
local curcontext="$curcontext" state line
integer ret=1
typeset -A opt_args
_arguments -C \
"(- :)"{-h,--help}"[Show help]" \
"(-D --debug)"{-D,--debug}"[Enable debug mode]" \
'(-s --stroage-path)'{-s,--storage-path}'[Configures storage path]:file:_files' \
'--tls-ca-cert[CA to verify remotes against]:file:_files' \
'--tls-ca-key[Private key to generate certificates]:file:_files' \
'--tls-client-cert[Client cert to use for TLS]:file:_files' \
'--tls-client-key[Private key used in client TLS auth]:file:_files' \
'--github-api-token[Token to use for requests to the Github API]' \
'--native-ssh[Use the native (Go-based) SSH implementation.]' \
'--bugsnag-api-token[BugSnag API token for crash reporting]' \
'(- :)'{-v,--version}'[Print the version]' \
"(-): :->command" \
"(-)*:: :->option-or-argument" && ret=0
case $state in
(command)
__docker-machine_commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:docker-machine-$words[1]:
__docker-machine_subcommand && ret=0
ret=0
;;
esac
return ret
}
_docker-machine "$@"

View File

@ -1,6 +1,6 @@
#compdef docker dockerd
#
# zsh completion for docker (http://docker.com)
# zsh completion for docker (https://docker.com)
#
# version: 0.3.0
# github: https://github.com/felixr/docker-zsh-completion
@ -431,7 +431,7 @@ __docker_complete_events_filter() {
integer ret=1
declare -a opts
opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'type' 'volume')
opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'scope' 'type' 'volume')
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
@ -461,6 +461,11 @@ __docker_complete_events_filter() {
(network)
__docker_complete_networks && ret=0
;;
(scope)
local -a scope_opts
scope_opts=('local' 'swarm')
_describe -t scope-filter-opts "scope filter options" scope_opts && ret=0
;;
(type)
local -a type_opts
type_opts=('container' 'daemon' 'image' 'network' 'volume')
@ -923,7 +928,7 @@ __docker_container_subcommand() {
local state
_arguments $(__docker_arguments) \
$opts_help \
opts_create_run_update \
$opts_create_run_update \
"($help -)*: :->values" && ret=0
case $state in
(values)

View File

@ -0,0 +1,9 @@
# Autocompletion for doctl, the command line tool for DigitalOcean service
#
# doctl project: https://github.com/digitalocean/doctl
#
# Author: https://github.com/HalisCz
if [ $commands[doctl] ]; then
source <(doctl completion zsh)
fi

View File

@ -2,19 +2,19 @@
Automatically load your project ENV variables from `.env` file when you `cd` into project root directory.
Storing configuration in the environment is one of the tenets of a [twelve-factor app](http://www.12factor.net). Anything that is likely to change between deployment environmentssuch as resource handles for databases or credentials for external servicesshould be extracted from the code into environment variables.
Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables.
## Installation
Just add the plugin to your `.zshrc`:
```sh
plugins=(git man dotenv)
plugins=(... dotenv)
```
## Usage
Create `.env` file inside your project directory and put your local ENV variables there.
Create `.env` file inside your project root directory and put your ENV variables there.
For example:
```sh
@ -30,5 +30,16 @@ SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
MONGO_URI=mongodb://127.0.0.1:27017
PORT=3001
```
You can even mix both formats, although it's probably a bad idea.
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it supposed to be local only.
## Version Control
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.
## Disclaimer
This plugin only sources the `.env` file. Nothing less, nothing more. It doesn't do any checks. It's designed to be the fastest and simplest option. You're responsible for the `.env` file content. You can put some code (or weird symbols) there, but do it on your own risk. `dotenv` is the basic tool, yet it does the job.
If you need more advanced and feature-rich ENV management, check out these awesome projects:
* [direnv](https://github.com/direnv/direnv)
* [zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv)

View File

@ -1,10 +1,19 @@
#!/bin/zsh
source_env() {
if [[ -f .env ]]; then
source .env
# test .env syntax
zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2
if [[ -o a ]]; then
source .env
else
set -a
source .env
set +a
fi
fi
}
autoload -U add-zsh-hook
add-zsh-hook chpwd source_env
source_env

View File

@ -16,4 +16,4 @@ Author: [Fabio Fernandes](https://github.com/fabiofl)
- Upload a file: `droplr ./path/to/file/`
- Shorten a link: `droplr http://example.com`
- Shorten a link: `droplr https://example.com`

30
plugins/emacs/README.md Normal file
View File

@ -0,0 +1,30 @@
# Emacs plugin
This plugin utilizes the Emacs daemon capability, allowing the user to quickly open frames, whether they are opened in a terminal via a ssh connection, or X frames opened on the same host. The plugin also provides some aliases for such operations.
- You don't have the cost of starting Emacs all the time anymore
- Opening a file is as fast as Emacs does not have anything else to do.
- You can share opened buffered across opened frames.
- Configuration changes made at runtime are applied to all frames.
**NOTE:** requires Emacs 24 and newer.
To use it, add emacs to the plugins array in your zshrc file:
```zsh
plugins=(... emacs)
```
## Aliases
The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that is just a wrapper around [`emacsclient`](https://www.emacswiki.org/emacs/EmacsClient).
| Alias | Command | Description |
|--------|----------------------------------------------------|----------------------------------------------------------------|
| emacs | `$EMACS_LAUNCHER --no-wait` | Opens a temporary emacsclient frame |
| e | `emacs` | Same as emacs alias |
| te | `$EMACS_LAUNCHER -nw` | Open terminal emacsclient |
| eeval | `$EMACS_LAUNCHER --eval` | Same as `M-x eval` but from outside Emacs |
| eframe | `emacsclient --alternate-editor "" --create-frame` | Create new X frame |
| efile | - | Print the path to the file open in the current buffer |
| ecd | - | Print the directory of the file open in the the current buffer |

View File

@ -1,8 +1,8 @@
# Ember CLI
**Maintainers:** [BilalBudhani](http://www.github.com/BilalBudhani), [eubenesa](http://www.github.com/eubenesa)
**Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa), [scottkidder](https://github.com/scottkidder]
Ember CLI (http://www.ember-cli.com/)
Ember CLI (https://www.ember-cli.com/)
### List of Aliases
@ -17,5 +17,6 @@ Alias | Ember-CLI command
**ein** | *ember init*
**ei** | *ember install*
**et** | *ember test*
**ets** | *ember test --serve*
**eu** | *ember update*
**ev** | *ember version*

View File

@ -1,5 +1,5 @@
# Ember CLI
# Visit http://www.ember-cli.com/ to view user guide
# Visit https://www.ember-cli.com/ to view user guide
alias es='ember serve'
alias ea='ember addon'
@ -10,6 +10,7 @@ alias eh='ember help'
alias ein='ember init'
alias ei='ember install'
alias et='ember test'
alias ets='ember test --serve'
alias eu='ember update'
# version

View File

@ -0,0 +1,14 @@
# emoji-clock
The plugin displays current time as an emoji symbol with half hour accuracy.
To use it, add `emoji-clock` to the plugins array of your zshrc file:
```
plugins=(... emoji-clock)
```
## Features
| Function | Description |
|-------------------|----------------------------------------------------------------------|
| `emoji-clock` | Displays current time in clock emoji symbol with half hour accuracy |

View File

@ -71,7 +71,7 @@ PROMPT="$surfer > "
## Technical Details
The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at http://www.unicode.org/reports/tr51/index.html.
The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at https://www.unicode.org/reports/tr51/index.html.
The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke)
@ -108,7 +108,7 @@ The `$emoji_skintone` associative array maps skin tone IDs to the variation sele
echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]"
```
Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](http://www.unicode.org/reports/tr51/index.html#Diversity) for details.
Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](https://www.unicode.org/reports/tr51/index.html#Diversity) for details.
## TODO
@ -130,6 +130,6 @@ This does *not* mean that it should use Gemoji at run time. None of the `zsh` pl
#### ZWJ combining function
One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](http://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences).
One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](https://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences).
These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears.

View File

@ -17,7 +17,7 @@
# none: not applicable
# Field 4 — Emoji_Sources:
# one or more values from {z, a, j, w, x}
# see the key in http://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources
# see the key in https://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources
# NA: not applicable
# Comment — currently contains the version where the character was first encoded,
# followed by:
@ -1200,7 +1200,7 @@
1F1F2 1F1ED ; emoji ; L2 ; none ; x # V6.0 (🇲🇭) flag for Marshall Islands
1F1F2 1F1F0 ; emoji ; L2 ; none ; x # V6.0 (🇲🇰) flag for Macedonia
1F1F2 1F1F1 ; emoji ; L2 ; none ; x # V6.0 (🇲🇱) flag for Mali
1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar
1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar
1F1F2 1F1F3 ; emoji ; L2 ; none ; x # V6.0 (🇲🇳) flag for Mongolia
1F1F2 1F1F4 ; emoji ; L2 ; none ; x # V6.0 (🇲🇴) flag for Macau
1F1F2 1F1F5 ; emoji ; L2 ; none ; x # V6.0 (🇲🇵) flag for Northern Mariana Islands

View File

@ -5,15 +5,15 @@
# This script generates the emoji.plugin.zsh emoji definitions from the Unicode
# character data for the emoji characters.
#
# The data file can be found at http://unicode.org/Public/emoji/latest/emoji-data.txt
# as referenced in Unicode TR51 (http://www.unicode.org/reports/tr51/index.html).
# The data file can be found at https://unicode.org/Public/emoji/latest/emoji-data.txt
# as referenced in Unicode TR51 (https://www.unicode.org/reports/tr51/index.html).
#
# This is known to work with the data file from version 1.0. It may not work with later
# versions if the format changes. In particular, this reads line comments to get the
# emoji character name and unicode version.
#
# Country names have punctuation and other non-letter characters removed from their name,
# to avoid possible complications with having to escape the strings when using them as
# to avoid possible complications with having to escape the strings when using them as
# array subscripts. The definition file seems to use some combining characters like accents
# that get stripped during this process.
@ -41,7 +41,7 @@ sub process_emoji_data_file {
#
# This contains the definition for:
# \$emoji - which maps character names to Unicode characters
# \$emoji_flags - maps country names to Unicode flag characters using region indicators
# \$emoji_flags - maps country names to Unicode flag characters using region indicators
# Main emoji
typeset -gAH emoji
@ -63,7 +63,7 @@ typeset -gAH emoji_mod
next if /^\s*#/ or /^\s*$/;
if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) {
my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name)
my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name)
= ($1, $2, $3, $4, $5, $6, $7);
#print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n";
my @code_points = split /\s+/, $code;
@ -84,7 +84,7 @@ typeset -gAH emoji_mod
if ($flag_country) {
$outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n");
} else {
$outfh->print("emoji[$omz_name]=\$'$zsh_code'\n");
$outfh->print("emoji[$omz_name]=\$'$zsh_code'\n");
}
# Modifiers are included in both the main set and their separate map,
# because they have a standalone representation as a color swatch.

View File

@ -0,0 +1,69 @@
# encode64
Alias plugin for encoding or decoding using `base64` command
## Functions and Aliases
| Function | Alias | Description |
| ---------- | ----- | ------------------------------ |
| `encode64` | `e64` | Encodes given data to base64 |
| `decode64` | `d64` | Decodes given data from base64 |
## Enabling plugin
1. Edit your `.zshrc` file and add `encode64` to the list of plugins:
```sh
plugins=(
# ...other enabled plugins
encode64
)
```
2. Restart your terminal session or reload configuration by running:
```sh
source ~/.zshrc
```
## Usage and examples
### Encoding
- From parameter
```console
$ encode64 "oh-my-zsh"
b2gtbXktenNo
$ e64 "oh-my-zsh"
b2gtbXktenNo
```
- From piping
```console
$ echo "oh-my-zsh" | encode64
b2gtbXktenNo==
$ echo "oh-my-zsh" | e64
b2gtbXktenNo==
```
### Decoding
- From parameter
```console
$ decode64 b2gtbXktenNo
oh-my-zsh%
$ d64 b2gtbXktenNo
oh-my-zsh%
```
- From piping
```console
$ echo "b2gtbXktenNoCg==" | decode64
oh-my-zsh
$ echo "b2gtbXktenNoCg==" | decode64
oh-my-zsh
```

View File

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

View File

@ -29,7 +29,7 @@ extract() {
success=0
extract_dir="${1:t:r}"
case "$1" in
case "${1:l}" in
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz)
@ -45,8 +45,8 @@ extract() {
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)

View File

@ -7,5 +7,6 @@ if [ $commands[fasd] ]; then # check if fasd is installed
unset fasd_cache
alias v="f -e \"$EDITOR\""
alias o='a -e open_command'
alias o='a -e xdg-open'
alias j='zz'
fi

1
plugins/fedora/README.md Normal file
View File

@ -0,0 +1 @@
The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.

View File

@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent"
function fwl () {
# converts output to zsh array ()
# @f flag split on new line
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}")
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
for i in $zones; do
sudo firewall-cmd --zone $i --list-all

View File

@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X.
### Requirements
* [ForkLift](http://www.binarynights.com/forklift/)
* [ForkLift](https://binarynights.com/)
### Usage

View File

@ -1,6 +1,6 @@
# Open folder in ForkLift.app or ForkLift2.app from console
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift2 by Johan Kaving
# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving
#
# Usage:
# fl [<folder>]
@ -24,46 +24,84 @@ function fl {
fi
osascript 2>&1 1>/dev/null <<END
try
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift2"
end tell
on error err_msg number err_num
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift"
end tell
end try
try
tell application "Finder"
set forkLift3 to name of application file id "com.binarynights.ForkLift-3"
end tell
on error err_msg number err_num
set forkLift3 to null
end try
try
tell application "Finder"
set forkLift2 to name of application file id "com.binarynights.ForkLift2"
end tell
on error err_msg number err_num
set forkLift2 to null
end try
try
tell application "Finder"
set forkLift to name of application file id "com.binarynights.ForkLift"
end tell
on error err_msg number err_num
set forkLift to null
end try
if application appName is running
tell application appName
if forkLift3 is not null and application forkLift3 is running then
tell application forkLift3
activate
end tell
else
tell application appName
set forkLiftVersion to version
end tell
else if forkLift2 is not null and application forkLift2 is running then
tell application forkLift2
activate
end tell
repeat until application appName is running
delay 1
end repeat
tell application appName
set forkLiftVersion to version
end tell
else if forkLift is not null and application forkLift is running then
tell application forkLift
activate
end tell
set forkLiftVersion to version
end tell
else
if forkLift3 is not null then
set appName to forkLift3
else if forkLift2 is not null then
set appName to forkLift2
else if forkLift is not null then
set appName to forkLift
end if
tell application appName
activate
set forkLiftVersion to version
end tell
repeat until application appName is running
delay 1
end repeat
tell application appName
activate
end tell
end if
tell application "System Events"
tell application process "ForkLift"
tell application "System Events"
tell application process "ForkLift"
try
set topWindow to window 1
set topWindow to window 1
on error
keystroke "n" using command down
set topWindow to window 1
keystroke "n" using command down
set topWindow to window 1
end try
keystroke "g" using {command down, shift down}
tell sheet 1 of topWindow
set value of text field 1 to "$PWD"
keystroke return
end tell
end tell
if forkLiftVersion starts with "3" then
tell pop over of list of group of splitter group of splitter group of topWindow
set value of text field 1 to "$PWD"
end tell
else
tell sheet 1 of topWindow
set value of text field 1 to "$PWD"
end tell
end if
keystroke return
end tell
end tell
END
}

View File

@ -35,13 +35,13 @@ Available search contexts are:
| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` |
| aurajs | `http://aurajs.com/api/#stq=` |
| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` |
| bootsnipp | `http://bootsnipp.com/search?q=` |
| caniuse | `http://caniuse.com/#search=` |
| codepen | `http://codepen.io/search?q=` |
| bootsnipp | `https://bootsnipp.com/search?q=` |
| caniuse | `https://caniuse.com/#search=` |
| codepen | `https://codepen.io/search?q=` |
| compassdoc | `http://compass-style.org/search?q=` |
| cssflow | `http://www.cssflow.com/search?q=` |
| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` |
| emberjs | `http://emberjs.com/api/#stp=1&stq=` |
| emberjs | `https://emberjs.com/api/#stp=1&stq=` |
| fontello | `http://fontello.com/#search=` |
| html5please | `http://html5please.com/#` |
| jquery | `https://api.jquery.com/?s=` |
@ -51,7 +51,7 @@ Available search contexts are:
| qunit | `https://api.qunitjs.com/?s=` |
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` |
| stackoverflow | `http://stackoverflow.com/search?q=` |
| stackoverflow | `https://stackoverflow.com/search?q=` |
| unheap | `http://www.unheap.com/?s=` |
If you want to have another context, open an Issue and tell us!
@ -62,4 +62,4 @@ If you want to have another context, open an Issue and tell us!
**Wilson Mendes (willmendesneto)**
+ <https://plus.google.com/+WilsonMendes>
+ <https://twitter.com/willmendesneto>
+ <http://github.com/willmendesneto>
+ <https://github.com/willmendesneto>

View File

@ -29,13 +29,13 @@ function frontend() {
angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q='
aurajs 'http://aurajs.com/api/#stq='
bem 'https://google.com/search?as_sitesearch=bem.info&as_q='
bootsnipp 'http://bootsnipp.com/search?q='
caniuse 'http://caniuse.com/#search='
codepen 'http://codepen.io/search?q='
bootsnipp 'https://bootsnipp.com/search?q='
caniuse 'https://caniuse.com/#search='
codepen 'https://codepen.io/search?q='
compassdoc 'http://compass-style.org/search?q='
cssflow 'http://www.cssflow.com/search?q='
dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
emberjs 'http://emberjs.com/api/#stp=1&stq='
emberjs 'https://emberjs.com/api/#stp=1&stq='
fontello 'http://fontello.com/#search='
html5please 'http://html5please.com/#'
jquery 'https://api.jquery.com/?s='
@ -45,7 +45,7 @@ function frontend() {
qunit 'https://api.qunitjs.com/?s='
reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q='
smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q='
stackoverflow 'http://stackoverflow.com/search?q='
stackoverflow 'https://stackoverflow.com/search?q='
unheap 'http://www.unheap.com/?s='
)

19
plugins/fzf/README.md Normal file
View File

@ -0,0 +1,19 @@
# fzf
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
```zsh
# Set fzf installation directory path
export FZF_BASE=/path/to/fzf/install/dir
# Uncomment the following line to disable fuzzy completion
# export DISABLE_FZF_AUTO_COMPLETION="true"
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
# export DISABLE_FZF_KEY_BINDINGS="true"
plugins=(
...
fzf
)
```

View File

@ -0,0 +1,57 @@
test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}"
if [[ -z "${fzf_base}" ]]; then
fzfdirs=(
"${HOME}/.fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
)
for dir in ${fzfdirs}; do
if [[ -d "${dir}" ]]; then
fzf_base="${dir}"
break
fi
done
if [[ -z "${fzf_base}" ]]; then
if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then
if [[ -d "${dir}" ]]; then
fzf_base="${dir}"
fi
fi
fi
fi
if [[ -n "${fzf_base}" ]]; then
# Fix fzf shell directory for Archlinux package
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
fzf_shell="${fzf_base}"
else
fzf_shell="${fzf_base}/shell"
fi
# Setup fzf
# ---------
if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then
export PATH="$PATH:$fzf_base/bin"
fi
# Auto-completion
# ---------------
if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then
[[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null
fi
# Key bindings
# ------------
if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then
source "${fzf_shell}/key-bindings.zsh"
fi
else
print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\
"Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2
fi
unset fzf_base fzf_shell dir fzfdirs

View File

@ -1,6 +1,6 @@
## ZSH-Geeknote
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh).
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh.
Plugins provides:

17
plugins/gem/README.md Normal file
View File

@ -0,0 +1,17 @@
# Gem plugin
This plugin adds completions and aliases for [Gem](https://rubygems.org/). The completions include the common `gem` subcommands as well as the installed gems in the current directory.
To use it, add `gem` to the plugins array in your zshrc file:
```zsh
plugins=(... gem)
```
## Aliases
| Alias | Command | Description |
|----------------------|-------------------------------|--------------------------------------------|
| gemb | `gem build *.gemspec` | Build a gem from a gemspec |
| gemp | `gem push *.gem` | Push a gem up to the gem server |
| gemy [gem] [version] | `gem yank [gem] -v [version]` | Remove a pushed gem version from the index |

View File

@ -0,0 +1,31 @@
# Git auto-fetch
Automatically fetches all changes from all remotes while you are working in git-initialized directory.
#### Usage
Add `git-auto-fetch` to the plugins array in your zshrc file:
```shell
plugins=(... git-auto-fetch)
```
Every time you launch a command in your shell all remotes will be fetched in background.
By default autofetch will be triggered only if last fetch was done at least 60 seconds ago.
You can change fetch interval in your .zshrc:
```
GIT_AUTO_FETCH_INTERVAL=1200 #in seconds
```
Log of `git fetch --all` will be saved into `.git/FETCH_LOG`
#### Toggle auto fetch per folder
If you are using mobile connection or for any other reason you can disable git-auto-fetch for any folder:
```shell
$ cd to/your/project
$ git-auto-fetch
disabled
$ git-auto-fetch
enabled
```

View File

@ -0,0 +1,27 @@
GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60}
function git-fetch-all {
(`git rev-parse --is-inside-work-tree 2>/dev/null` &&
dir=`git rev-parse --git-dir` &&
[[ ! -f $dir/NO_AUTO_FETCH ]] &&
(( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) &&
git fetch --all &>! $dir/FETCH_LOG &)
}
function git-auto-fetch {
`git rev-parse --is-inside-work-tree 2>/dev/null` || return
guard="`git rev-parse --git-dir`/NO_AUTO_FETCH"
(rm $guard 2>/dev/null &&
echo "${fg_bold[green]}enabled${reset_color}") ||
(touch $guard &&
echo "${fg_bold[red]}disabled${reset_color}")
}
eval "override-git-auto-fetch-$(declare -f zle-line-init)"
function zle-line-init () {
git-fetch-all
override-git-auto-fetch-zle-line-init
}
zle -N zle-line-init

View File

@ -1,6 +1,6 @@
# git-extras
This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras).
This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras).
## Setup notes

View File

@ -2,7 +2,7 @@
# Description
# -----------
#
# Completion script for git-extras (http://github.com/tj/git-extras).
# Completion script for git-extras (https://github.com/tj/git-extras).
#
# This depends on and reuses some of the internals of the _git completion
# function that ships with zsh itself. It will not work with the _git that ships
@ -19,8 +19,8 @@
# Inspirations
# -----------
#
# * git-extras (http://github.com/tj/git-extras)
# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
# * git-extras (https://github.com/tj/git-extras)
# * git-flow-completion (https://github.com/bobthecow/git-flow-completion)
#
# ------------------------------------------------------------------------------
@ -47,6 +47,14 @@ __gitex_commits() {
_describe -t commits commit commits && ret=0
}
__gitex_remote_names() {
local expl
declare -a remote_names
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
__git_command_successful || return
_wanted remote-names expl remote-name compadd $* - $remote_names
}
__gitex_tag_names() {
local expl
declare -a tag_names
@ -69,7 +77,11 @@ __gitex_specific_branch_names() {
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
_wanted branch-names expl branch-name compadd - $branch_names
}
__gitex_chore_branch_names() {
__gitex_specific_branch_names 'chore'
}
__gitex_feature_branch_names() {
@ -102,6 +114,11 @@ __gitex_author_names() {
}
# subcommands
_git-authors() {
_arguments -C \
'(--list -l)'{--list,-l}'[show authors]' \
'--no-email[without email]' \
}
_git-bug() {
local curcontext=$curcontext state line ret=1
@ -126,8 +143,16 @@ _git-bug() {
_arguments -C \
':branch-name:__gitex_bug_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
@ -136,6 +161,40 @@ _git-changelog() {
'(-l --list)'{-l,--list}'[list commits]' \
}
_git-chore() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C \
': :->command' \
'*:: :->option-or-argument' && ret=0
case $state in
(command)
declare -a commands
commands=(
'finish:merge and delete the chore branch'
)
_describe -t commands command commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
(finish)
_arguments -C \
':branch-name:__gitex_chore_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
_git-contrib() {
@ -149,6 +208,27 @@ _git-count() {
'--all[detailed commit count]'
}
_git-create-branch() {
local curcontext=$curcontext state line
_arguments -C \
': :->command' \
'*:: :->option-or-argument'
case "$state" in
(command)
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
esac
}
_git-delete-branch() {
_arguments \
@ -220,10 +300,17 @@ _git-feature() {
_arguments -C \
':branch-name:__gitex_feature_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
}
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
_git-graft() {
_arguments \
@ -231,14 +318,39 @@ _git-graft() {
':dest-branch-name:__gitex_branch_names'
}
_git-guilt() {
_arguments -C \
'(--email -e)'{--email,-e}'[display author emails instead of names]' \
'(--ignore-whitespace -w)'{--ignore-whitespace,-w}'[ignore whitespace only changes]' \
'(--debug -d)'{--debug,-d}'[output debug information]' \
'-h[output usage information]'
}
_git-ignore() {
_arguments -C \
'(--local -l)'{--local,-l}'[show local gitignore]' \
'(--global -g)'{--global,-g}'[show global gitignore]'
'(--global -g)'{--global,-g}'[show global gitignore]' \
'(--private -p)'{--private,-p}'[show repo gitignore]'
}
_git-ignore() {
_arguments -C \
'(--append -a)'{--append,-a}'[append .gitignore]' \
'(--replace -r)'{--replace,-r}'[replace .gitignore]' \
'(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \
'(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \
'(--search -s)'{--search,-s}'[search word in available types]'
}
_git-merge-into() {
_arguments '--ff-only[merge only fast-forward]'
_arguments \
':src:__gitex_branch_names' \
':dest:__gitex_branch_names'
}
_git-missing() {
_arguments \
':first-branch-name:__gitex_branch_names' \
@ -269,8 +381,16 @@ _git-refactor() {
_arguments -C \
':branch-name:__gitex_refactor_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
@ -279,6 +399,23 @@ _git-squash() {
':branch-name:__gitex_branch_names'
}
_git-stamp() {
_arguments -C \
'(--replace -r)'{--replace,-r}'[replace stamps with same id]'
}
_git-standup() {
_arguments -C \
'-a[Specify the author of commits. Use "all" to specify all authors.]' \
'-d[Show history since N days ago]' \
'-D[Specify the date format displayed in commit history]' \
'-f[Fetch commits before showing history]' \
'-g[Display GPG signed info]' \
'-h[Display help message]' \
'-L[Enable the inclusion of symbolic links]' \
'-m[The depth of recursive directory search]'
}
_git-summary() {
_arguments '--line[summarize with lines rather than commits]'
__gitex_commits
@ -291,45 +428,71 @@ _git-undo(){
'(--hard -h)'{--hard,-h}'[wipes your commit(s)]'
}
zstyle ':completion:*:*:git:*' user-commands \
zstyle -g existing_user_commands ':completion:*:*:git:*' user-commands
zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
alias:'define, search and show aliases' \
archive-file:'export the current HEAD of the git repository to a archive' \
archive-file:'export the current head of the git repository to an archive' \
authors:'generate authors report' \
back:'undo and stage latest commits' \
bug:'create a bug branch' \
changelog:'populate changelog file with commits since the previous tag' \
commits-since:'list commits since a given date' \
contrib:'display author contributions' \
count:'count commits' \
create-branch:'create local and remote branch' \
delete-branch:'delete local and remote branch' \
delete-merged-branches:'delete merged branches'\
delete-submodule:'delete submodule' \
delete-tag:'delete local and remote tag' \
effort:'display effort statistics' \
extras:'git-extras' \
feature:'create a feature branch' \
bug:'create bug branch' \
bulk:'run bulk commands' \
changelog:'generate a changelog report' \
chore:'create chore branch' \
clear-soft:'soft clean up a repository' \
clear:'rigorously clean up a repository' \
commits-since:'show commit logs since some date' \
contrib:'show user contributions' \
count:'show commit count' \
create-branch:'create branches' \
delete-branch:'delete branches' \
delete-merged-branches:'delete merged branches' \
delete-submodule:'delete submodules' \
delete-tag:'delete tags' \
delta:'lists changed files' \
effort:'show effort statistics on file(s)' \
extras:'awesome git utilities' \
feature:'create/merge feature branch' \
force-clone:'overwrite local repositories with clone' \
fork:'fork a repo on github' \
fresh-branch:'create empty local branch' \
gh-pages:'create the GitHub Pages branch' \
graft:'merge commits from source branch to destination branch' \
ignore:'add patterns to .gitignore' \
info:'show info about the repository' \
local-commits:'list unpushed commits on the local branch' \
fresh-branch:'create fresh branches' \
gh-pages:'create the github pages branch' \
graft:'merge and destroy a given branch' \
guilt:'calculate change between two revisions' \
ignore-io:'get sample gitignore file' \
ignore:'add .gitignore patterns' \
info:'returns information on current repository' \
local-commits:'list local commits' \
lock:'lock a file excluded from version control' \
locked:'ls files that have been locked' \
merge-into:'merge one branch into another' \
merge-repo:'merge two repo histories' \
missing:'show commits missing from another branch' \
mr:'checks out a merge request locally' \
obliterate:'rewrite past commits to remove some files' \
pr:'checks out a pull request locally' \
psykorebase:'rebase a branch with a merge commit' \
pull-request:'create pull request to GitHub project' \
reauthor:'replace the author and/or committer identities in commits and tags' \
rebase-patch:'rebases a patch' \
refactor:'create a refactor branch' \
refactor:'create refactor branch' \
release:'commit, tag and push changes to the repository' \
rename-branch:'rename a branch' \
rename-tag:'rename a tag' \
repl:'read-eval-print-loop' \
repl:'git read-eval-print-loop' \
reset-file:'reset one file' \
root:'show path of root' \
setup:'setup a git repository' \
scp:'copy files to ssh compatible `git-remote`' \
sed:'replace patterns in git-controlled files' \
setup:'set up a git repository' \
show-merged-branches:'show merged branches' \
show-tree:'show branch tree of commit history' \
squash:'merge commits from source branch into the current one as a single commit' \
summary:'repository summary' \
touch:'one step creation of new files' \
undo:'remove the latest commit' \
show-unmerged-branches:'show unmerged branches' \
squash:'import changes from a branch' \
stamp:'stamp the last commit message' \
standup:'recall the commit history' \
summary:'show repository summary' \
sync:'sync local branch with remote branch' \
touch:'touch and add file to the index' \
undo:'remove latest commits' \
unlock:'unlock a file excluded from version control'

View File

@ -5,8 +5,8 @@
#
# To achieve git-flow completion nirvana:
#
# 0. Update your zsh's git-completion module to the newest verion.
# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
# 0. Update your zsh's git-completion module to the newest version.
# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git
#
# 1. Install this file. Either:
#
@ -22,398 +22,527 @@
_git-flow ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
case $state in
(command)
local -a subcommands
subcommands=(
'init:Initialize a new git repo with support for the branching model.'
'feature:Manage your feature branches.'
'config:Manage your configuration.'
'release:Manage your release branches.'
'hotfix:Manage your hotfix branches.'
'support:Manage your support branches.'
'version:Shows version information.'
'finish:Finish the branch you are currently on.'
'delete:Delete the branch you are currently on.'
'publish:Publish the branch you are currently on.'
)
_describe -t commands 'git flow' subcommands
;;
local -a subcommands
subcommands=(
'init:Initialize a new git repo with support for the branching model.'
'feature:Manage your feature branches.'
'bugfix:Manage your bugfix branches.'
'config:Manage your configuration.'
'release:Manage your release branches.'
'hotfix:Manage your hotfix branches.'
'support:Manage your support branches.'
'version:Shows version information.'
'finish:Finish the branch you are currently on.'
'delete:Delete the branch you are currently on.'
'publish:Publish the branch you are currently on.'
'rebase:Rebase the branch you are currently on.'
)
_describe -t commands 'git flow' subcommands
;;
(options)
case $line[1] in
(options)
case $line[1] in
(init)
_arguments \
-f'[Force setting of gitflow branches, even if already configured]'
;;
(init)
_arguments \
-f'[Force setting of gitflow branches, even if already configured]'
;;
(version)
;;
(version)
;;
(hotfix)
__git-flow-hotfix
;;
(hotfix)
__git-flow-hotfix
;;
(release)
__git-flow-release
;;
(release)
__git-flow-release
;;
(feature)
__git-flow-feature
;;
(config)
__git-flow-config
;;
(feature)
__git-flow-feature
;;
(bugfix)
__git-flow-bugfix
;;
esac
;;
esac
(config)
__git-flow-config
;;
esac
;;
esac
}
__git-flow-release ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new release branch.'
'finish:Finish a release branch.'
'list:List all your release branches. (Alias to `git flow release`)'
'publish:Publish release branch to remote.'
'track:Checkout remote release branch.'
'delete:Delete a release branch.'
)
_describe -t commands 'git flow release' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
local -a subcommands
subcommands=(
'start:Start a new release branch.'
'finish:Finish a release branch.'
'list:List all your release branches. (Alias to `git flow release`)'
'publish:Publish release branch to remote.'
'track:Checkout remote release branch.'
'rebase:Rebase from integration branch.'
'delete:Delete a release branch.'
)
_describe -t commands 'git flow release' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':version:__git_flow_version_list'
;;
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':version:__git_flow_version_list'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\
':version:__git_flow_version_list'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\
':version:__git_flow_version_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':version:__git_flow_version_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':version:__git_flow_version_list'
;;
(publish)
_arguments \
':version:__git_flow_version_list'
;;
(publish)
_arguments \
':version:__git_flow_version_list'
;;
(track)
_arguments \
':version:__git_flow_version_list'
;;
(track)
_arguments \
':version:__git_flow_version_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-hotfix ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new hotfix branch.'
'finish:Finish a hotfix branch.'
'delete:Delete a hotfix branch.'
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
)
_describe -t commands 'git flow hotfix' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
local -a subcommands
subcommands=(
'start:Start a new hotfix branch.'
'finish:Finish a hotfix branch.'
'delete:Delete a hotfix branch.'
'rebase:Rebase from integration branch.'
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
'rename:Rename a hotfix branch.'
)
_describe -t commands 'git flow hotfix' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':hotfix:__git_flow_version_list'\
':branch-name:__git_branch_names'
;;
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':hotfix:__git_flow_version_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\
':hotfix:__git_flow_hotfix_list'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-s'[Sign the release tag cryptographically]'\
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
-m'[Use the given tag message]'\
-p'[Push to $ORIGIN after performing finish]'\
':hotfix:__git_flow_hotfix_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':hotfix:__git_flow_hotfix_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':hotfix:__git_flow_hotfix_list'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-feature ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new feature branch.'
'finish:Finish a feature branch.'
'delete:Delete a feature branch.'
'list:List all your feature branches. (Alias to `git flow feature`)'
'publish:Publish feature branch to remote.'
'track:Checkout remote feature branch.'
'diff:Show all changes.'
'rebase:Rebase from integration branch.'
'checkout:Checkout local feature branch.'
'pull:Pull changes from remote.'
)
_describe -t commands 'git flow feature' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
local -a subcommands
subcommands=(
'start:Start a new feature branch.'
'finish:Finish a feature branch.'
'delete:Delete a feature branch.'
'list:List all your feature branches. (Alias to `git flow feature`)'
'publish:Publish feature branch to remote.'
'track:Checkout remote feature branch.'
'diff:Show all changes.'
'rebase:Rebase from integration branch.'
'checkout:Checkout local feature branch.'
'pull:Pull changes from remote.'
'rename:Rename a feature branch.'
)
_describe -t commands 'git flow feature' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':feature:__git_flow_feature_list'\
':branch-name:__git_branch_names'
;;
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':feature:__git_flow_feature_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Rebase instead of merge]'\
':feature:__git_flow_feature_list'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Rebase instead of merge]'\
':feature:__git_flow_feature_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':feature:__git_flow_feature_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':feature:__git_flow_feature_list'
;;
(publish)
_arguments \
':feature:__git_flow_feature_list'\
;;
(publish)
_arguments \
':feature:__git_flow_feature_list'\
;;
(track)
_arguments \
':feature:__git_flow_feature_list'\
;;
(track)
_arguments \
':feature:__git_flow_feature_list'\
;;
(diff)
_arguments \
':branch:__git_branch_names'\
;;
(diff)
_arguments \
':branch:__git_branch_names'\
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
(checkout)
_arguments \
':branch:__git_flow_feature_list'\
;;
(checkout)
_arguments \
':branch:__git_flow_feature_list'\
;;
(pull)
_arguments \
':remote:__git_remotes'\
':branch:__git_branch_names'
;;
(pull)
_arguments \
':remote:__git_remotes'\
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-bugfix ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
'start:Start a new bugfix branch.'
'finish:Finish a bugfix branch.'
'delete:Delete a bugfix branch.'
'list:List all your bugfix branches. (Alias to `git flow bugfix`)'
'publish:Publish bugfix branch to remote.'
'track:Checkout remote bugfix branch.'
'diff:Show all changes.'
'rebase:Rebase from integration branch.'
'checkout:Checkout local bugfix branch.'
'pull:Pull changes from remote.'
'rename:Rename a bugfix branch.'
)
_describe -t commands 'git flow bugfix' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':bugfix:__git_flow_bugfix_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Rebase instead of merge]'\
':bugfix:__git_flow_bugfix_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':bugfix:__git_flow_bugfix_list'
;;
(publish)
_arguments \
':bugfix:__git_flow_bugfix_list'\
;;
(track)
_arguments \
':bugfix:__git_flow_bugfix_list'\
;;
(diff)
_arguments \
':branch:__git_branch_names'\
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
(checkout)
_arguments \
':branch:__git_flow_bugfix_list'\
;;
(pull)
_arguments \
':remote:__git_remotes'\
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-config ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
case $state in
(command)
local -a subcommands
subcommands=(
'list:List the configuration. (Alias to `git flow config`)'
'set:Set the configuration option'
)
_describe -t commands 'git flow config' subcommands
;;
local -a subcommands
subcommands=(
'list:List the configuration. (Alias to `git flow config`)'
'set:Set the configuration option'
)
_describe -t commands 'git flow config' subcommands
;;
(options)
case $line[1] in
(options)
case $line[1] in
(set)
_arguments \
--local'[Use repository config file]' \
--global'[Use global config file]'\
--system'[Use system config file]'\
--file'[Use given config file]'\
':option:(master develop feature hotfix release support versiontagprefix)'
;;
(set)
_arguments \
--local'[Use repository config file]' \
--global'[Use global config file]'\
--system'[Use system config file]'\
--file'[Use given config file]'\
':option:(master develop feature hotfix release support versiontagprefix)'
;;
*)
_arguments \
--local'[Use repository config file]' \
--global'[Use global config file]'\
--system'[Use system config file]'\
--file'[Use given config file]'
;;
esac
;;
esac
*)
_arguments \
--local'[Use repository config file]' \
--global'[Use global config file]'\
--system'[Use system config file]'\
--file'[Use given config file]'
;;
esac
;;
esac
}
__git_flow_version_list ()
{
local expl
declare -a versions
local expl
declare -a versions
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted versions expl 'version' compadd $versions
_wanted versions expl 'version' compadd $versions
}
__git_flow_feature_list ()
{
local expl
declare -a features
local expl
declare -a features
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted features expl 'feature' compadd $features
_wanted features expl 'feature' compadd $features
}
__git_flow_bugfix_list ()
{
local expl
declare -a bugfixes
bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted bugfixes expl 'bugfix' compadd $bugfixes
}
__git_remotes () {
local expl gitdir remotes
local expl gitdir remotes
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
__git_command_successful || return
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
__git_command_successful || return
# TODO: Should combine the two instead of either or.
if (( $#remotes > 0 )); then
_wanted remotes expl remote compadd $* - $remotes
else
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
fi
# TODO: Should combine the two instead of either or.
if (( $#remotes > 0 )); then
_wanted remotes expl remote compadd $* - $remotes
else
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
fi
}
__git_flow_hotfix_list ()
{
local expl
declare -a hotfixes
local expl
declare -a hotfixes
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted hotfixes expl 'hotfix' compadd $hotfixes
_wanted hotfixes expl 'hotfix' compadd $hotfixes
}
__git_branch_names () {
local expl
declare -a branch_names
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__git_command_successful || return
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
_wanted branch-names expl branch-name compadd $* - $branch_names
}
__git_command_successful () {
if (( ${#pipestatus:#0} > 0 )); then
_message 'not a git repository'
return 1
fi
return 0
if (( ${#pipestatus:#0} > 0 )); then
_message 'not a git repository'
return 1
fi
return 0
}
zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations'

View File

@ -10,22 +10,23 @@ plugins=(... git-flow)
## Aliases
More information about `git-flow` commands:
More information about `git-flow` commands:
https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
| Alias | Command | Description |
|---------|---------------------------|----------------------------------------|
| `gfl` | `git flow` | Git-Flow command |
| `gfli` | `git flow init` | Initialize git-flow repository |
| `gcd` | `git checkout develop` | Check out develop branch |
| `gch` | `git checkout hotfix` | Check out hotfix branch |
| `gcr` | `git checkout release` | Check out release branch |
| `gflf` | `git flow feature` | List existing feature branches |
| `gflh` | `git flow hotfix` | List existing hotfix branches |
| `gflr` | `git flow release` | List existing release branches |
| `gflfs` | `git flow feature start` | Start a new feature: `gflfs <name>` |
| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs <version>` |
| `gflrs` | `git flow release start` | Start a new release: `gflrs <version>` |
| `gflff` | `git flow feature finish` | Finish feature: `gflff <name>` |
| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf <version>` |
| `gflrf` | `git flow release finish` | Finish release: `gflrf <version>` |
| Alias | Command | Description |
|---------|----------------------------|----------------------------------------|
| `gfl` | `git flow` | Git-Flow command |
| `gfli` | `git flow init` | Initialize git-flow repository |
| `gcd` | `git checkout develop` | Check out develop branch |
| `gch` | `git checkout hotfix` | Check out hotfix branch |
| `gcr` | `git checkout release` | Check out release branch |
| `gflf` | `git flow feature` | List existing feature branches |
| `gflh` | `git flow hotfix` | List existing hotfix branches |
| `gflr` | `git flow release` | List existing release branches |
| `gflfs` | `git flow feature start` | Start a new feature: `gflfs <name>` |
| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs <version>` |
| `gflrs` | `git flow release start` | Start a new release: `gflrs <version>` |
| `gflff` | `git flow feature finish` | Finish feature: `gflff <name>` |
| `gflfp` | `git flow feature publish` | Publish feature: `gflfp <name>` |
| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf <version>` |
| `gflrf` | `git flow release finish` | Finish release: `gflrf <version>` |

View File

@ -33,6 +33,7 @@ alias gflfs='git flow feature start'
alias gflhs='git flow hotfix start'
alias gflrs='git flow release start'
alias gflff='git flow feature finish'
alias gflfp='git flow feature publish'
alias gflhf='git flow hotfix finish'
alias gflrf='git flow release finish'
alias gflfp='git flow feature publish'

View File

@ -6,7 +6,7 @@
# To achieve git-hubflow completion nirvana:
#
# 0. Update your zsh's git-completion module to the newest version.
# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git
#
# 1. Install this file. Either:
#

View File

@ -1,5 +1,5 @@
# ZSH Git Prompt Plugin from:
# http://github.com/olivierverdier/zsh-git-prompt
# https://github.com/olivierverdier/zsh-git-prompt
__GIT_PROMPT_DIR="${0:A:h}"

View File

@ -22,7 +22,7 @@ def get_tagname_or_hash():
tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1]
if tagname:
return tagname
return tagname.replace(' ', '')
elif hash_:
return hash_
return None

View File

@ -44,12 +44,14 @@ alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbD='git branch -D'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
@ -70,7 +72,7 @@ alias gcam='git commit -a -m'
alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
alias gcl='git clone --recurse-submodules'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
alias gcm='git checkout master'
@ -88,6 +90,7 @@ alias gd='git diff'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gds='git diff --staged'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
@ -180,10 +183,11 @@ alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glols="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
@ -198,6 +202,8 @@ alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpf='git push --force-with-lease'
alias gpf!='git push --force'
alias gpoat='git push origin --all && git push origin --tags'
compdef _git gpoat=git-push
alias gpu='git push upstream'
@ -208,11 +214,14 @@ alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbd='git rebase develop'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias grh='git reset'
alias grhh='git reset --hard'
alias grm='git rm'
alias grmc='git rm --cached'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
@ -223,6 +232,7 @@ alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsh='git show'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
@ -235,6 +245,7 @@ alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gstall='git stash --all'
alias gsu='git submodule update'
alias gts='git tag -s'
@ -244,6 +255,8 @@ alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias gupa='git pull --rebase --autostash'
alias gupav='git pull --rebase --autostash -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'

138
plugins/gitfast/README.md Normal file
View File

@ -0,0 +1,138 @@
# Gitfast plugin
This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version..
To use it, add `gitfast` to the plugins array in your zshrc file:
```zsh
plugins=(... gitfast)
```
## Aliases
| Alias | Command |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| g | `git` |
| ga | `git add` |
| gaa | `git add --all` |
| gapa | `git add --patch` |
| gau | `git add --update` |
| gb | `git branch` |
| gba | `git branch -a` |
| gbd | `git branch -d` |
| gbda | `git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d` |
| gbl | `git blame -b -w` |
| gbnm | `git branch --no-merged` |
| gbr | `git branch --remote` |
| gbs | `git bisect` |
| gbsb | `git bisect bad` |
| gbsg | `git bisect good` |
| gbsr | `git bisect reset` |
| gbss | `git bisect start` |
| gc | `git commit -v` |
| gc! | `git commit -v --amend` |
| gca | `git commit -v -a` |
| gca! | `git commit -v -a --amend` |
| gcam | `git commit -a -m` |
| gcan! | `git commit -v -a --no-edit --amend` |
| gcans! | `git commit -v -a -s --no-edit --amend` |
| gcb | `git checkout -b` |
| gcd | `git checkout develop` |
| gcf | `git config --list` |
| gcl | `git clone --recursive` |
| gclean | `git clean -fd` |
| gcm | `git checkout master` |
| gcmsg | `git commit -m` |
| gcn! | `git commit -v --no-edit --amend` |
| gco | `git checkout` |
| gcount | `git shortlog -sn` |
| gcp | `git cherry-pick` |
| gcpa | `git cherry-pick --abort` |
| gcpc | `git cherry-pick --continue` |
| gcs | `git commit -S` |
| gcsm | `git commit -s -m` |
| gd | `git diff` |
| gdca | `git diff --cached` |
| gdct | `` git describe --tags `git rev-list --tags --max-count=1` `` |
| gdt | `git diff-tree --no-commit-id --name-only -r` |
| gdw | `git diff --word-diff` |
| gf | `git fetch` |
| gfa | `git fetch --all --prune` |
| gfo | `git fetch origin` |
| gg | `git gui citool` |
| gga | `git gui citool --amend` |
| ggpull | `git pull origin $(git_current_branch)` |
| ggpur | `ggu` |
| ggpush | `git push origin $(git_current_branch)` |
| ggsup | `git branch --set-upstream-to=origin/$(git_current_branch)` |
| ghh | `git help` |
| gignore | `git update-index --assume-unchanged` |
| gignored | `git ls-files -v | grep "^[[:lower:]]"` |
| git-svn-dcommit-push | `git svn dcommit && git push github master:svntrunk` |
| gk | `\gitk --all --branches` |
| gke | `\gitk --all $(git log -g --pretty=%h)` |
| gl | `git pull` |
| glg | `git log --stat` |
| glgg | `git log --graph` |
| glgga | `git log --graph --decorate --all` |
| glgm | `git log --graph --max-count=10` |
| glgp | `git log --stat -p` |
| glo | `git log --oneline --decorate` |
| glog | `git log --oneline --decorate --graph` |
| gloga | `git log --oneline --decorate --graph --all` |
| glol | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit` |
| glola | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --all` |
| glp | `_git_log_prettily` |
| glum | `git pull upstream master` |
| gm | `git merge` |
| gmom | `git merge origin/master` |
| gmt | `git mergetool --no-prompt` |
| gmtvim | `git mergetool --no-prompt --tool=vimdiff` |
| gmum | `git merge upstream/master` |
| gp | `git push` |
| gpd | `git push --dry-run` |
| gpoat | `git push origin --all && git push origin --tags` |
| gpristine | `git reset --hard && git clean -dfx` |
| gpsup | `git push --set-upstream origin $(git_current_branch)` |
| gpu | `git push upstream` |
| gpv | `git push -v` |
| gr | `git remote` |
| gra | `git remote add` |
| grb | `git rebase` |
| grba | `git rebase --abort` |
| grbc | `git rebase --continue` |
| grbi | `git rebase -i` |
| grbm | `git rebase master` |
| grbs | `git rebase --skip` |
| grh | `git reset HEAD` |
| grhh | `git reset HEAD --hard` |
| grmv | `git remote rename` |
| grrm | `git remote remove` |
| grset | `git remote set-url` |
| grt | `cd $(git rev-parse --show-toplevel || echo ".")` |
| gru | `git reset --` |
| grup | `git remote update` |
| grv | `git remote -v` |
| gsb | `git status -sb` |
| gsd | `git svn dcommit` |
| gsi | `git submodule init` |
| gsps | `git show --pretty=short --show-signature` |
| gsr | `git svn rebase` |
| gss | `git status -s` |
| gst | `git status` |
| gsta | `git stash save` |
| gstaa | `git stash apply` |
| gstc | `git stash clear` |
| gstd | `git stash drop` |
| gstl | `git stash list` |
| gstp | `git stash pop` |
| gsts | `git stash show --text` |
| gsu | `git submodule update` |
| gts | `git tag -s` |
| gtv | `git tag | sort -V` |
| gunignore | `git update-index --no-assume-unchanged` |
| gunwip | `git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1` |
| gup | `git pull --rebase` |
| gupv | `git pull --rebase -v` |
| gwch | `git whatchanged -p --abbrev-commit --pretty=medium` |
| gwip | `git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"` |

View File

@ -11,14 +11,14 @@ This plugin supports working with GitHub from the command line. It provides a fe
* `empty_gh` - Creates a new empty repo (with a `README.md`) and pushes it to GitHub
* `new_gh` - Initializes an existing directory as a repo and pushes it to GitHub
* `exist_gh` - Takes an existing repo and pushes it to GitHub
* `git.io` - Shortens a URL using [git.io](http://git.io)
* `git.io` - Shortens a URL using [git.io](https://git.io)
## Installation
[Hub](http://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ.
[Hub](https://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ.
The [`github` Ruby gem](http://github.com/defunkt/github-gem) needs to be installed if you want to use it.
The [`github` Ruby gem](https://github.com/defunkt/github-gem) needs to be installed if you want to use it.
### Configuration

View File

@ -1,4 +1,4 @@
# Set up hub wrapper for git, if it is available; http://github.com/github/hub
# Set up hub wrapper for git, if it is available; https://github.com/github/hub
if (( $+commands[hub] )); then
alias git=hub
fi
@ -36,7 +36,7 @@ new_gh() { # [DIRECTORY]
print '.*'"\n"'*~' >> .gitignore
git add [^.]* \
|| return
git add .gitignore \
git add -f .gitignore \
|| return
git commit -m 'Initial commit.' \
|| return
@ -63,7 +63,7 @@ exist_gh() { # [DIRECTORY]
# git.io "GitHub URL"
#
# Shorten GitHub url, example:
# https://github.com/nvogel/dotzsh > http://git.io/8nU25w
# https://github.com/nvogel/dotzsh > https://git.io/8nU25w
# source: https://github.com/nvogel/dotzsh
# documentation: https://github.com/blog/985-git-io-github-url-shortener
#

View File

@ -0,0 +1,17 @@
# gitignore
This plugin enables you the use of [gitignore.io](https://www.gitignore.io/) from the command line. You need an active internet connection.
To use it, add `gitignore` to the plugins array in your zshrc file:
```zsh
plugins=(... gitignore)
```
## Plugin commands
* `gi list`: List all the currently supported gitignore.io templates.
* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files.
* `gi [TEMPLATENAME] >> .gitignore`: Appending programming language settings to your projects .gitignore.

View File

@ -1,7 +1,7 @@
function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} }
_gitignoreio_get_command_list() {
curl -fL https://www.gitignore.io/api/list | tr "," "\n"
curl -sfL https://www.gitignore.io/api/list | tr "," "\n"
}
_gitignoreio () {

View File

@ -2,7 +2,7 @@
Expands all glob expressions, subcommands and aliases (including global).
Idea from: http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html.
Idea from: https://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html.
## Usage

1
plugins/go/README.md Normal file
View File

@ -0,0 +1 @@
The go plugin is deprecated. Use the [golang plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/golang) instead.

29
plugins/golang/README.md Normal file
View File

@ -0,0 +1,29 @@
# Golang plugin
This plugin adds completion for the [Go Programming Language](https://golang.org/),
as well as some aliases for common Golang commands.
To use it, add `golang` to the plugins array in your zshrc file:
```zsh
plugins=(... golang)
```
## Aliases
| Alias | Command | Description |
| ------- | ----------------------- | ------------------------------------------------------------- |
| gob | `go build` | Build your code |
| goc | `go clean` | Removes object files from package source directories |
| god | `go doc` | Prints documentation comments |
| gof | `go fmt` | Gofmt formats (aligns and indents) Go programs. |
| gofa | `go fmt ./...` | Run go fmt for all packages in current directory, recursively |
| gog | `go get` | Downloads packages and then installs them to $GOPATH |
| goi | `go install` | Compiles and installs packages to $GOPATH |
| gol | `go list` | Lists Go packages |
| gop | `cd $GOPATH` | Takes you to $GOPATH |
| gopb | `cd $GOPATH/bin` | Takes you to $GOPATH/bin |
| gops | `cd $GOPATH/src` | Takes you to $GOPATH/src |
| gor | `go run` | Compiles and runs your code |
| got | `go test` | Runs tests |
| gov | `go vet` | Vet examines Go source code and reports suspicious constructs |

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