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

Re: completion for man



Andy Spiegl <zsh.Andy@xxxxxxxxx>:
> Recently I heard/read that there is a new wonderful completion function for
> man with support sections.  But my zsh (v4.3.2) doesn't do it and always
> just completes the command names:
> 
>  condor:~>man <TAB>
>  zsh: do you wish to see all 13618 possibilities (6810 lines)? 
> 
>  condor:~>man 8 <TAB>
>  zsh: do you wish to see all 13618 possibilities (6810 lines)? 
> 
> Is there maybe some configuration option I have to set?

Hi Andy,

Starting from 'zsh -f' you need the following:

[snip]
zmodload zsh/complist
autoload -U compinit && compinit
zstyle ':completion:*'              menu select
zstyle ':completion:*:*:man:*'      menu yes
zstyle ':completion:*'              group-name ''
zstyle ':completion:*:manuals'      separate-sections true
zstyle ':completion:*:manuals.*'    insert-sections   true
zstyle ':completion:*:descriptions' format "- %d -"
[snap]

You can even do:
zstyle ':completion:*:manuals.(^1*)' insert-sections true

...to add the section number for all sections but section number one.

Regards, Frank



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