├── symfony-console.plugin.zsh └── README.md /symfony-console.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Symfony console completion 2 | 3 | _symfony_console_get_command_list () { 4 | ./console --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }' 5 | } 6 | 7 | _symfony_console () { 8 | compadd `_symfony_console_get_command_list` 9 | } 10 | 11 | compdef _symfony_console 'console' 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Symfony Console completion in Zsh 2 | 3 | This is an [Oh My Zsh](https://github.com/robbyrussell/oh-my-zsh) plugin for the Symfony Console component. 4 | 5 | Oh My Zsh already comes with a Symfony2 plugin which offers completion for `app/console` or `bin/console`. However if you use the Console component outside of the Symfony framework, you might simply be using `./console` and autocompletion will not work. 6 | 7 | This plugin will provide autocompletion for `./console`. 8 | 9 | ## Install 10 | 11 | Clone the repository in `.oh-my-zsh/custom/plugins` (this is a gitignored directory to allow you to add your own plugins, so it will not mess up oh-my-zsh): 12 | 13 | ``` 14 | cd ~/.oh-my-zsh/custom/plugins 15 | git clone https://github.com/mnapoli/zsh-symfony-console-plugin.git symfony-console 16 | ``` 17 | 18 | (watch out, the directory must be named `symfony-console`) 19 | 20 | Edit `~/.zshrc` to enable the plugin: 21 | 22 | ``` 23 | plugins=(... symfony-console) 24 | ``` 25 | 26 | ## Why not edit the existing `symfony2` plugin 27 | 28 | At the moment there are [366 pull requests](https://github.com/robbyrussell/oh-my-zsh/pulls) open on the Oh My Zsh repository (dating up to 2012). I have no hopes of seing it merged anytime soon. 29 | --------------------------------------------------------------------------------