Unverified Commit 8c95c523 authored by Kozlov Alexander's avatar Kozlov Alexander Committed by GitHub
Browse files

Merge branch 'master' into master

parents dd30cf10 3d8f2bda
# 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
...@@ -15,8 +15,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed ...@@ -15,8 +15,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /etc/profile.d/autojump.sh . /etc/profile.d/autojump.sh
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
. /usr/local/share/autojump/autojump.zsh . /usr/local/share/autojump/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports elif [ -f /opt/local/etc/profile.d/autojump.sh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh . /opt/local/etc/profile.d/autojump.sh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew
. `brew --prefix`/etc/autojump.sh . `brew --prefix`/etc/autojump.sh
fi fi
......
# 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)
```
# aws
This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support
and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`.
To use it, add `aws` to the plugins array in your zshrc file.
```zsh
plugins=(... aws)
```
## Plugin commands
* `asp <profile>`: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
It also adds it to your RPROMPT.
* `agp`: Gets the current value of `AWS_PROFILE`.
* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function.
...@@ -21,10 +21,8 @@ _awscli-homebrew-installed() { ...@@ -21,10 +21,8 @@ _awscli-homebrew-installed() {
[ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null
} }
export AWS_HOME=~/.aws
function agp { function agp {
echo $AWS_DEFAULT_PROFILE echo $AWS_PROFILE
} }
function asp { function asp {
...@@ -33,20 +31,19 @@ function asp { ...@@ -33,20 +31,19 @@ function asp {
export AWS_DEFAULT_PROFILE=$1 export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1 export AWS_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt" export RPROMPT="<aws:$AWS_PROFILE>$rprompt"
} }
function aws_profiles { function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) reply=($(grep profile "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
} }
compctl -K aws_profiles asp compctl -K aws_profiles asp
if _homebrew-installed && _awscli-homebrew-installed ; then if which aws_zsh_completer.sh &>/dev/null; then
_aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null)
elif _homebrew-installed && _awscli-homebrew-installed; then
_aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
else
_aws_zsh_completer_path=$(which aws_zsh_completer.sh)
fi fi
[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path [ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
unset _aws_zsh_completer_path unset _aws_zsh_completer_path
# 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)'
```
## bbedit ## 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 ### Requirements
* [BBEdit](http://www.barebones.com/products/bbedit/) * [BBEdit](https://www.barebones.com/products/bbedit/)
* [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html) * [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html)
### Usage ### Usage
......
...@@ -10,10 +10,10 @@ Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-ba ...@@ -10,10 +10,10 @@ Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-ba
Just add bgnotify to your plugins list in your `.zshrc` Just add bgnotify to your plugins list in your `.zshrc`
- On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier) - On OS X you'll need [terminal-notifier](https://github.com/alloy/terminal-notifier)
* `brew install terminal-notifier` (or `gem install terminal-notifier`) * `brew install terminal-notifier` (or `gem install terminal-notifier`)
- On ubuntu you're already all set! - 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 ## Screenshots
......
...@@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle) ...@@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle)
elif hash notify-send 2>/dev/null; then #ubuntu gnome! elif hash notify-send 2>/dev/null; then #ubuntu gnome!
notify-send "$1" "$2" notify-send "$1" "$2"
elif hash kdialog 2>/dev/null; then #ubuntu kde! 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! elif hash notifu 2>/dev/null; then #cygwyn support!
notifu /m "$2" /p "$1" notifu /m "$2" /p "$1"
fi fi
......
# 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. |
# 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. |
alias brewp='brew pin'
alias brews='brew list -1' alias brews='brew list -1'
alias brewsp='brew list --pinned'
alias bubo='brew update && brew outdated' alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup' alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc' alias bubu='bubo && bubc'
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
- adds completion for basic bundler commands - adds completion for basic bundler commands
- adds short aliases for common 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` - `bl` aliased to `bundle list`
- `bp` aliased to `bundle package` - `bp` aliased to `bundle package`
- `bo` aliased to `bundle open` - `bo` aliased to `bundle open`
...@@ -13,7 +14,8 @@ ...@@ -13,7 +14,8 @@
- looks for a binstub under `./bin/` and executes it (if present) - looks for a binstub under `./bin/` and executes it (if present)
- calls `bundle exec <gem executable>` otherwise - 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 ## Configuration
......
...@@ -14,6 +14,7 @@ bundled_commands=( ...@@ -14,6 +14,7 @@ bundled_commands=(
cucumber cucumber
foodcritic foodcritic
guard guard
hanami
irb irb
jekyll jekyll
kitchen kitchen
...@@ -53,10 +54,14 @@ done ...@@ -53,10 +54,14 @@ done
## Functions ## Functions
bundle_install() { 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` local bundler_version=`bundle version | cut -d' ' -f3`
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
if [[ "$OSTYPE" = darwin* ]] if [[ "$OSTYPE" = (darwin|freebsd)* ]]
then then
local cores_num="$(sysctl -n hw.ncpu)" local cores_num="$(sysctl -n hw.ncpu)"
else else
...@@ -66,8 +71,6 @@ bundle_install() { ...@@ -66,8 +71,6 @@ bundle_install() {
else else
bundle install $@ bundle install $@
fi fi
else
echo "Can't 'bundle install' outside a bundled project"
fi fi
} }
......
# Bwana
This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
To use it add bwana to the plugins array in your zshrc file.
```bash
plugins=(... bwana)
```
# #
# Requires http://www.bruji.com/bwana/ # Requires https://www.bruji.com/bwana/
# #
if [[ -e /Applications/Bwana.app ]] || if [[ -e /Applications/Bwana.app ]] ||
( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana ) ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
...@@ -9,5 +9,5 @@ then ...@@ -9,5 +9,5 @@ then
} }
else else
echo "Bwana lets you read man files in Safari through a man: URI scheme" 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 fi
# Cabal
This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It
also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox.
To use it, add cabal to the plugins array of your zshrc file:
```
plugins=(... cabal)
```
# Capistrano
This plugin provides completion for [Capistrano](https://capistranorb.com/).
To use it add capistrano to the plugins array in your zshrc file.
```bash
plugins=(... capistrano)
```
For a working completion use the `capit` command instead of `cap`, because cap is a
[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module).
`capit` automatically runs cap with bundler if a Gemfile is found.
# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work. # Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
func capit() { function capit() {
if [ -f Gemfile ] if [ -f Gemfile ]
then then
bundle exec cap $* bundle exec cap $*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment