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

Re: zsh-newuser-install

On Apr 26,  3:49pm, Yuri D'Elia wrote:
} You gave a quite nice list of features here, and with very concise
} configuration settings that do not depend on each other.
} I would actually *love* to have a zshcheatsheet manual page with this
} sort of thing.

Here's an idea:  Let's collect some default completion zstyles and put
them in a file in $fpath, named so that compinit arranges for it to be
autoloaded the same way it picks up completers etc.  Then, if that
function is defined, execute it from compinit.  This would make it easy
to change locally (just put a file of that name earlier in $fpath) and
it also allows us to create the defaults by consensus.

Per my previous remark about testing for prior existence, all the styles
in this defaults file would need to be defined using this function or
something like it:

emulate zsh -c 'default_zstyle() {
  local -a patstyle defn
  if [[ $1 = (-e|-|--) ]]
  then patstyle=( $2 $3 )
  else patstyle=( $1 $2 )
  zstyle -g defn $patstyle || zstyle $*


default_zstyle ':completion:*' group-name ''
default_zstyle ':completion:*' verbose true
default_zstyle ':completion:*' ignore-parents parent pwd ..
default_zstyle ':completion:*' format '%SCompleting %U%d%u%s'
default_zstyle ':completion:*:messages' format %S%d%s
default_zstyle ':completion:*:warnings' format 'No matches for %U%d%u'

# Double colon here to avoid overriding the value set by "zed"
default_zstyle ':completion::*' insert-tab 'pending=1'

Thoughts?  Name for this file?

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