diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/aws/aws.plugin.zsh | 15 | ||||
-rw-r--r-- | plugins/brew/_brew | 1 | ||||
-rw-r--r-- | plugins/brew/brew.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/bundler/README.md | 49 | ||||
-rw-r--r-- | plugins/bundler/_bundler | 13 | ||||
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 45 | ||||
-rw-r--r-- | plugins/composer/composer.plugin.zsh | 4 | ||||
-rw-r--r-- | plugins/git/git.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/rvm/rvm.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/symfony2/symfony2.plugin.zsh | 17 | ||||
-rw-r--r-- | plugins/tmuxinator/_tmuxinator | 6 |
11 files changed, 135 insertions, 21 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 3f7fb1995..8b57d7db1 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,3 +1,11 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_awscli-homebrew-installed() { + brew --prefix awscli &> /dev/null +} + export AWS_HOME=~/.aws function agp { @@ -14,4 +22,9 @@ function aws_profiles { } compctl -K aws_profiles asp -source `which aws_zsh_completer.sh` + +if _homebrew-installed && _awscli-homebrew-installed ; then + source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh +else + source `which aws_zsh_completer.sh` +fi diff --git a/plugins/brew/_brew b/plugins/brew/_brew index 9eb3bb557..40442a1d3 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -50,6 +50,7 @@ _1st_arguments=( 'server:start a local web app that lets you browse formulae (requires Sinatra)' 'services:small wrapper around `launchctl` for supported formulae' 'tap:tap a new formula repository from GitHub, or list existing taps' + 'uninstall:uninstall a formula' 'unlink:unlink a formula' 'unpin:unpin specified formulae' 'untap:remove a tapped repository' diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index f9497aefb..42fb80c9a 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,2 +1,2 @@ alias brews='brew list -1' -alias bubu="brew update && brew upgrade" +alias bubu="brew update && brew upgrade && brew cleanup" diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md new file mode 100644 index 000000000..56f0c7176 --- /dev/null +++ b/plugins/bundler/README.md @@ -0,0 +1,49 @@ +# Bundler + +- adds completion for basic bundler commands +- adds short aliases for common bundler commands + - `be` aliased to `bundle exec` + - `bl` aliased to `bundle list` + - `bp` aliased to `bundle package` + - `bo` aliased to `bundle open` + - `bu` aliased to `bundle update` + - `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`) +- adds a wrapper for common gems: + - looks for a binstub under `./bin/` and executes it (if present) + - calls `bundle exec <gem executable>` otherwise + +For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file. + +## Configuration + +Please use the exact name of the executable and not the gem name. + +### Add additional gems to be wrapped + +Add this before the plugin-list in your `.zshrc`: +```sh +BUNDLED_COMMANDS=(rubocop) +plugins=(... bundler ...) +``` +This will add the wrapper for the `rubocop` gem (i.e. the executable). + + +### Exclude gems from being wrapped + +Add this before the plugin-list in your `.zshrc`: +```sh +UNBUNDLED_COMMANDS=(foreman spin) +plugins=(... bundler ...) +``` +This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped. + +## Excluded gems + +These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification. + +`berks` +`foreman` +`mailcatcher` +`rails` +`ruby` +`spin` diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler index 2ec3a5f9c..ba647ab80 100644 --- a/plugins/bundler/_bundler +++ b/plugins/bundler/_bundler @@ -18,11 +18,13 @@ case $state in "check[Determine whether the requirements for your application are installed]" \ "list[Show all of the gems in the current bundle]" \ "show[Show the source location of a particular gem in the bundle]" \ + "outdated[Show all of the outdated gems in the current bundle]" \ "console[Start an IRB session in the context of the current bundle]" \ "open[Open an installed gem in the editor]" \ "viz[Generate a visual representation of your dependencies]" \ "init[Generate a simple Gemfile, placed in the current directory]" \ "gem[Create a simple gem, suitable for development with bundler]" \ + "platform[Displays platform compatibility information]" \ "clean[Cleans up unused gems in your bundler directory]" \ "help[Describe available tasks or one specific task]" ret=0 @@ -39,11 +41,13 @@ case $state in 'check' \ 'list' \ 'show' \ + 'outdated' \ 'console' \ 'open' \ 'viz' \ 'init' \ 'gem' \ + 'platform' \ 'help' && ret=0 ;; install) @@ -71,6 +75,15 @@ case $state in '(--verbose)--verbose[Enable verbose output mode]' ret=0 ;; + outdated) + _arguments \ + '(--pre)--pre[Check for newer pre-release gems]' \ + '(--source)--source[Check against a specific source]' \ + '(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \ + '(--no-color)--no-color[Disable colorization in output]' \ + '(--verbose)--verbose[Enable verbose output mode]' + ret=0 + ;; (open|show) _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) if [[ $_gems != "" ]]; then diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index fbdbc0244..617dcde71 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -5,15 +5,49 @@ alias bo="bundle open" alias bu="bundle update" alias bi="bundle_install" -# The following is based on https://github.com/gma/bundler-exec - -bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork spring strainer tailor taps thin thor unicorn unicorn_rails) +bundled_commands=( + annotate + cap + capify + cucumber + foodcritic + guard + irb + jekyll + kitchen + knife + middleman + nanoc + pry + puma + rackup + rainbows + rake + rspec + shotgun + sidekiq + spec + spork + spring + strainer + tailor + taps + thin + thor + unicorn + unicorn_rails +) # Remove $UNBUNDLED_COMMANDS from the bundled_commands list for cmd in $UNBUNDLED_COMMANDS; do bundled_commands=(${bundled_commands#$cmd}); done +# Add $BUNDLED_COMMANDS to the bundled_commands list +for cmd in $BUNDLED_COMMANDS; do + bundled_commands+=($cmd); +done + ## Functions bundle_install() { @@ -55,7 +89,7 @@ _binstubbed() { _run-with-bundler() { if _bundler-installed && _within-bundled-project; then if _binstubbed $1; then - bundle exec "./bin/$@" + ./bin/$@ else bundle exec $@ fi @@ -71,7 +105,6 @@ for cmd in $bundled_commands; do alias $cmd=bundled_$cmd if which _$cmd > /dev/null 2>&1; then - compdef _$cmd bundled_$cmd=$cmd + compdef _$cmd bundled_$cmd=$cmd fi done - diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 86f2ca4df..2243dd3c1 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -47,5 +47,5 @@ alias cdu='composer dump-autoload' # 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/vendor/bin +# Add Composer's global & local binaries to PATH +export PATH=$PATH:~/.composer/vendor/bin:./bin diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9f7819df3..a76bb1cdf 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -7,6 +7,8 @@ alias gd='git diff' compdef _git gd=git-diff alias gdc='git diff --cached' compdef _git gdc=git-diff +alias gdt='git diff-tree --no-commit-id --name-only -r' +compdef _git gdc=git diff-tree --no-commit-id --name-only -r alias gl='git pull' compdef _git gl=git-pull alias gup='git pull --rebase' diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index ad23e18d7..234ac1642 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -6,7 +6,7 @@ alias gemsets='rvm gemset list' local ruby18='ruby-1.8.7' local ruby19='ruby-1.9.3' local ruby20='ruby-2.0.0' -local ruby21='ruby-2.1.1' +local ruby21='ruby-2.1.2' function rb18 { if [ -z "$1" ]; then diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 4c07349a4..1d5177e6d 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -1,22 +1,23 @@ # Symfony2 basic command completion _symfony2_get_command_list () { - php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' + php $(find . -maxdepth 2 -mindepth 1 -name 'console') --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' } _symfony2 () { - if [ -f app/console ]; then + if [ -f $(find . -maxdepth 2 -mindepth 1 -name 'console') ]; then compadd `_symfony2_get_command_list` fi } -compdef _symfony2 app/console +compdef _symfony2 $(find . -maxdepth 2 -mindepth 1 -name 'console') compdef _symfony2 sf #Alias -alias sf='php app/console' -alias sfcl='php app/console cache:clear' -alias sfroute='php app/console router:debug' -alias sfcontainer='php app/console container:debug' -alias sfgb='php app/console generate:bundle' +alias sf='php $(find . -maxdepth 2 -mindepth 1 -name 'console') ' +alias sfcl='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:clear' +alias sfcw='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:warmup' +alias sfroute='php $(find . -maxdepth 2 -mindepth 1 -name 'console') router:debug' +alias sfcontainer='php $(find . -maxdepth 2 -mindepth 1 -name 'console') container:debug' +alias sfgb='php $(find . -maxdepth 2 -mindepth 1 -name 'console') generate:bundle' diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator index cd227b7df..e4f8b6ce0 100644 --- a/plugins/tmuxinator/_tmuxinator +++ b/plugins/tmuxinator/_tmuxinator @@ -11,10 +11,12 @@ _arguments -C \ case $state in cmds) _values "tmuxinator command" \ + "new[create a new project file and open it in your editor]" \ "start[start a tmux session using project's tmuxinator config]" \ "open[create a new project file and open it in your editor]" \ "copy[copy source_project project file to a new project called new_project]" \ "delete[deletes the project called project_name]" \ + "debug[output the shell commands generated by a projet]" \ "implode[deletes all existing projects!]" \ "list[list all existing projects]" \ "doctor[look for problems in your configuration]" \ @@ -24,9 +26,9 @@ case $state in ;; args) case $line[1] in - start|open|copy|delete) + start|open|copy|delete|debug) _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`) - _values 'configs' $_configs + [[ -n "$_configs" ]] && _values 'configs' $_configs ret=0 ;; esac |