c2ae9e09ca1f33ff1e13e629a0b2e6bdd19f83a9
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #1344 from danielcsgomes/master
Added Composer Plugin and Symfony2 alias
Diff
1diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..c9b762d072ab2a3a0c7df36f76f91c6bc624da6b
4--- /dev/null
5+++ b/plugins/composer/composer.plugin.zsh
6@@ -0,0 +1,29 @@
7+# ------------------------------------------------------------------------------
8+# FILE: composer.plugin.zsh
9+# DESCRIPTION: oh-my-zsh composer plugin file.
10+# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
11+# VERSION: 1.0.0
12+# ------------------------------------------------------------------------------
13+
14+# Composer basic command completion
15+_composer_get_command_list () {
16+ composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
17+}
18+
19+_composer () {
20+ if [ -f composer.json ]; then
21+ compadd `_composer_get_command_list`
22+ fi
23+}
24+
25+compdef _composer composer
26+
27+# Aliases
28+alias c='composer'
29+alias csu='composer self-update'
30+alias cu='composer update'
31+alias ci='composer install'
32+alias ccp='composer create-project'
33+
34+# install composer in the current directory
35+alias cget='curl -s https://getcomposer.org/installer | php'
36diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
37index 644266841fe11393c8b253da3479f52383f7dfdf..223401298df2bbdeaffe9bff6716608b051c0716 100644
38--- a/plugins/symfony2/symfony2.plugin.zsh
39+++ b/plugins/symfony2/symfony2.plugin.zsh
40@@ -10,4 +10,8 @@ _symfony2 () {
41 fi
42 }
43
44-compdef _symfony2 app/console
45+compdef _symfony2 app/console
46+
47+#Alias
48+alias sf2='php app/console'
49+alias sf2clear='php app/console cache:clear'