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

Re: widget special PREFIX variable and cursor position with complete_in_word



Yuri D'Elia wrote:
> I wasn't sure before, but it doesn't seem to work for me.
> I see the function being called and ZLS_COLORS being set, but no
> colorization happens.

That's odd. Perhaps something in your setup conflicts with it. It'd be
interesting to know what.

I've just tried and it works for me starting from zsh -f:
  zsh -f
  zmodload zsh/complist
  autoload -U compinit
  fpath+=( /path/where/you've/put/the/function )
  zstyle ':completion:*::::' completer _show_ambiguity _complete
  compinit

  setopt noh<tab>

Do those steps work for you?

It isn't going to help if it doesn't work but I forgot the :q for
the last character of the prefix and it seems to be worth making the
pattern case-insensitive with (#i) as case-insensitive completion
matching is common:
ZLS_COLORS+=":=(#i)${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/$MATCH:q|)}${prefix[-1]:q}(#b)(?|)*==4"

Oliver



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