Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How an I list all of the styles defined in a zsh session using the zstyle command? I would like to know this so I know what configuration options are available to me.

share|improve this question
up vote 6 down vote accepted

zstyle -L lists all the styles that have been defined, with their values. For a slightly nicer display with only the patterns, you can use

zstyle-list-patterns () {
  local tmp
  zstyle -g tmp
  print -rl -- "${(@o)tmp}"

This is a far cry from your goal of listing all the styles that you can configure. For one thing, styles can be based on wildcards, which can be instantiated in infinitely many ways (for example, completion settings can be set per command).

There is no declaration of styles: a function that can be configured through a style calls the zstyle command to look up some value, possibly with variable arguments. It's impossible to anticipate what arguments are going to be passed to zstyle in the future. All you can do is consult the documentation of the function (when it exists) or its source code.

share|improve this answer
Thanks for your answer. I guess it is really unfortunate that I have to consult the documentation/src of a function to determine how it uses styles. – Zameer Manji Jul 22 '12 at 22:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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