MacOS – Tab completion in terminal with alias

aliasmacosterminalzsh

I'm running a zsh terminal under Yosemite and have defined a simple alias to place files in Yoink:

$ alias yoink='open -a Yoink'
$ yoink my-file-to-yoink.txt

This works great but for some unknown reason the tab completion to specify
the file does not work after yoink. It simple says -- no matches found --.

Is there a way I can use tab completing in combination with this alias?

Thanks.

ps: Not sure if it's related, but I'm using zprezto.

Best Answer

Did you tried zsh-completions?

$ brew info zsh-completions
zsh-completions: stable 0.12.0, HEAD
https://github.com/zsh-users/zsh-completions
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zsh-completions.rb
==> Caveats
To activate these completions, add the following to your .zshrc:

  fpath=(/usr/local/share/zsh-completions $fpath)

You may also need to force rebuild `zcompdump`:

  rm -f ~/.zcompdump; compinit

Additionally, if you receive "zsh compinit: insecure directories" warnings when attempting
to load these completions, you may need to run this:

  chmod go-w /usr/local/share