I use setopt menu_complete so that I can hit TAB repeatedly to get different filename completions in zsh. However, I would also like to be able to type:

ls ~/*.txt<TAB>

and then use TAB to cycle through all the files that end with .txt in my home directory. I do not want all matches to be inserted on the command line at once!

(I tried reading the relevant zsh man pages, but I think it could easily take me a week of reading just to figure out whether this is possible and perhaps another week to figure out how.)


You want the GLOB_COMPLETE option (see zshoptions). (By the way, this zsh reference card is quite useful.)

  • Perfect!! Thanks! I'm sure the reference card will come in handy. Somehow, I'm not at all surprised by the reference "card" being 14 pages long. :) – Aaron B. May 1 '12 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.