Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
zsh auto completion #5
On Twitter @solarce asked for zsh support of the bash auto completion. He's not the only one ;-).
Here's the steps necessary:
autoload -U bashcompinit bashcompinit
complete -C aws_completer aws
If your zsh bashcompinit works that should be it.
If not, you need to extend the zsh bashcompinit _bash_complete() function to export COMP_POINT and COMP_LINE.
14a15,16 > export COMP_POINT > export COMP_LINE
IMHO, it would be better to add a zsh completion that is evaluated when the shell is started. That completion config is kept in zsh RAM until the shell is terminated. The benefit is that the Python interpreter does not have to be started each time one hits . I'll give that a try after Christmas. Not sure if I get it done since I haven't written such a zsh compdef function so far.
I made the zsh completion work for zsh using the bash compatibility mode of zsh. It's here. I tested the Mac Mountain Lion shipped zsh, upstream zsh 5.0.2 and zsh 4.3.17 Ubuntu 12.04. In order to work around the issue described above I copied the just applied zsh fix or on the github clone.
It works. To make use of the greatness of zsh I will try to write a proper zsh compdef function in the next weeks. First I have to learn a little more about zsh ;-)
I'm not sure if it is worth to send a pull request for that one here.