Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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
1  
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
add comment

Your Answer

 
discard

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.