Skip to content

Commit

Permalink
added Composer completition and aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
dcsg committed Oct 5, 2012
1 parent e3de97c commit 6630919
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions plugins/composer/composer.plugin.zsh
@@ -0,0 +1,28 @@
# ------------------------------------------------------------------------------
# FILE: composer.plugin.zsh
# DESCRIPTION: oh-my-zsh composer plugin file.
# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------

# Composer basic command completion
_composer_get_command_list () {
composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
}

_composer () {
if [ -f composer.json ]; then
compadd `_composer_get_command_list`
fi
}

compdef _composer composer

# Aliases
alias c='composer'
alias csu='composer self-update'
alias cu='composer update'
alias ci='composer install'
alias ccp='composer create-project'

alias cget='curl -s https://getcomposer.org/installer | php'

0 comments on commit 6630919

Please sign in to comment.