Skip to content

Autocompleting radio stations in zsh

GijsTimmers edited this page Oct 22, 2016 · 2 revisions

yamlradio is made so that channels can be autocompleted in zsh. This feature may come in handy:

$ yamlradio st      ## Now press the TAB key
$ yamlradio stubru  ## Result

For this to work, execute the following commands

$ activate-global-python-argcomplete --user

Now, add the following lines at the end of your ~/.zshrc:

## Setting up argcomplete
## Remember to execute
## activate-global-python-argcomplete --user
## first!

autoload bashcompinit
bashcompinit
source ~/.bash_completion.d/python-argcomplete.sh

## now name the to be completed scripts
eval "$(register-python-argcomplete `which yamlradio`)"

Then, source the configuration to apply it:

$ source ~/.zshrc

If the command activate-global-python-argcomplete --user fails, make sure that you have argcomplete installed. If you install yamlradio with pip, argcomplete gets installed automatically.