Skip to content

Commit

Permalink
Merge pull request #1344 from danielcsgomes/master
Browse files Browse the repository at this point in the history
Added Composer Plugin and Symfony2 alias
  • Loading branch information
robbyrussell committed Oct 9, 2012
2 parents d4d2e6d + 9365fd0 commit c2ae9e0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
29 changes: 29 additions & 0 deletions plugins/composer/composer.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ------------------------------------------------------------------------------
# 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'

# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'
6 changes: 5 additions & 1 deletion plugins/symfony2/symfony2.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ _symfony2 () {
fi
}

compdef _symfony2 app/console
compdef _symfony2 app/console

#Alias
alias sf2='php app/console'
alias sf2clear='php app/console cache:clear'

0 comments on commit c2ae9e0

Please sign in to comment.