From 6630919bce0ec9eb5ad33c26a32cd5f06529d570 Mon Sep 17 00:00:00 2001 From: Daniel Gomes Date: Fri, 5 Oct 2012 21:13:10 +0100 Subject: added Composer completition and aliases --- plugins/composer/composer.plugin.zsh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plugins/composer/composer.plugin.zsh (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh new file mode 100644 index 000000000..a054ae2c5 --- /dev/null +++ b/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' \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 9365fd03f62854c48bc06388542ba4933eb067db Mon Sep 17 00:00:00 2001 From: Daniel Gomes Date: Fri, 5 Oct 2012 21:14:44 +0100 Subject: added a comment to the composer installation alias --- plugins/composer/composer.plugin.zsh | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index a054ae2c5..c9b762d07 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -25,4 +25,5 @@ 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' \ No newline at end of file -- cgit v1.2.3-70-g09d2