Composer Plugin for Oh My Zsh

less than 1 minute read

About Oh My Zsh

Is community-driven framework for managing your zsh configuration. It has more than 40+ plugins (git, symfony2, OSX, gem, ruby, etc) with a lots of handful functions, autocomplete feature and lots of useful alias. Also it brings a very good variety of themes or you can customize your own.

About Composer

Is a tool for dependency management in PHP. It's not a package manager but it deals with packages in a per project basis. See the composer documentation.

The Plugin

This is a very simple plugin for Oh My Zsh that adds composer autocomplete feature and useful aliases:

c = "composer"
c <tab> for autcomplete
csu = "composer self-update"
cu = "composer update"
ci = "composer install"
ccp = "composer create-project"
cget = "installs composer on the current path"

In the composer documentation you can find all the cli commands.

To add the plugin you need to make sure that your Oh My Zsh is updated. Then edit your .zshrc file:

vim ~/.zshrc

Find the plugins line and add composer to the end:

...
plugins=(git .... composer)

If you have any suggestions, I would love to hear about them.

Leave a Comment