Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: trying to learn zstyle



Shao Zhang wrote:
> 	How do I use zstyle to make mtvp to complete to the files with
> 	*.mpg or *.mpeg or *.MPG and so on.

Sorry, missed this bit.  The easy answer (again, this is post-3.1.6) is


_mtvp() { 
  local expl

  _description files expl 'MPEG file'
  _files "$expl[@]" -g '*.(mpg|mpeg|MPG)'
}
compdef _mtvp mtvp


I got that simply by copying the file _gunzip, which does the same thing
with .gz files.  Copying existing files is usually the way.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author