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

Re: Autocomplet with compdef _precommand



Bart Schaefer wrote on Tue, Aug 30, 2016 at 10:56:36 -0700:
> More generically, the only zstyle that modifies autocd behavior is for
> the "-command-" special context, so you have to use "zstyle -e" with
> an evaluated test that determines whether "start" was the precommand
> word AND whether the tags are being looked up for "cd":
> 
>     zstyle -e :completion::complete:-command-:: tag-order \
>       '(( $precommands[(I)start] && $funcstack[(I)_cd] )) && reply=(-)'
> 
> Question for zsh-workers:  Is it worth adding a style to _precommand
> to selectively turn off autocd?  If so, what should it be called?

Isn't that already possible? —

    zstyle -e :completion::complete:-command-:: tag-order \
      '(( $precommands[(I)start] )) && reply=("!local-directories" -)'



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