From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1140 invoked by alias); 31 Jan 2016 17:38:43 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21214 Received: (qmail 3919 invoked from network); 31 Jan 2016 17:38:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=WVgkfrofdJb09Xid3qbnOUTIoJ77166+5/yQ4UhDFMc=; b=ZpqClxi5aMrMTxZuYNe0msxayhAvX751Kpp4ew0IB81uWq4FleHfI9Tpc5VkK96x0a ex5IYSbmDwyPkOaZ8q3tmRjikvOYB9vw+cI8HrysU9Pb3erBwHMFrtU1ZEMcqMyeFnIG ro7iTrS7poZXRiJVBsECSEHxpzZB5y3/Eo/uVWdFxwTr4CQ5o+N8NjN/f3yaTMq+Y5u0 0FbzishHNQX/DqgnwB7jG8soFN7rp2xwhkxcfA4xcbGD7YmszQcpy29jnGCvI10Yef7z SFj27iD2zqBtEjTkxoX0niHr3mBZ5UwP5cQkui7bDo4Q4Rx4uOKb/jcFwQryc3fN+N01 2Z/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=WVgkfrofdJb09Xid3qbnOUTIoJ77166+5/yQ4UhDFMc=; b=aUfahHjY+ngqcRwTFYyqPHIBovMa9MrHkRag5eOLJgUS/gOr9QalDUbnto2qjj75z8 MdcddhQq6T7OxWngLsIhkxBHsOmAXNw3m9zI7be5JcRLN7cj7yAIeXUU67hISZsadnxb ISKfztIsrr87Yxf9Z8lgpa5AZ2jrev64H79SbDi4w+6NSSCStSUpw26VmsT2a10ZSwXa nktf6wK7dP/mvnL3li3iGNw06nokravL9mIQlKnzVRO3rX5QgVmclaN40yX98OMDnewJ ugdqvwehyVYvVaeBrR0GLuIJvZS96brDPvz1nLUs+Q81WXhx/5lt+QS2lD6RdG7DMu7q EOUw== X-Gm-Message-State: AG10YOT9Zw85sEgcB1Lj4LRveMUHVkQOF0OG95UubgixnVOYFcOHK3dHlS19oYMXhneKBw== X-Received: by 10.98.79.140 with SMTP id f12mr31760488pfj.102.1454261921563; Sun, 31 Jan 2016 09:38:41 -0800 (PST) From: Bart Schaefer Message-Id: <160131093929.ZM11508@torch.brasslantern.com> Date: Sun, 31 Jan 2016 09:39:29 -0800 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Color in completions" (Jan 31, 4:38pm) References: <160129144546.ZM24675@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Color in completions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jan 31, 4:38pm, Sebastian Gniazdowski wrote: } Subject: Re: Color in completions } } On 29 January 2016 at 23:45, Bart Schaefer wrote: } > You can get color in completion listings with the complist module, } > see "man zshmodules" or "info zsh 'The zsh/complist Module'". } } Managed to do this. Had to: } 1. Figure out to use _wanted instead of only compadd Actually I think it's _description that you need rather than _wanted, but calling _wanted gets you there via _all_labels ... Or you could just assign ZLS_COLORS yourself instead of using a style, I think, but calling _wanted is preferable. } 2. Figure out what pattern to give to zstyle: } } zstyle ':completion:*:zplugin:*:argument-rest' list-colors } '=(#b)(*)/(*)==1;35=1;33' } } When I display $curcontext within _zplugin (after adding -C to } _arguments), it shows: :complete:zplugin:argument-rest. I wonder why } do I need the additional ":*:" before "argument-rest" ? Or even the } first one. I don't know why you need the second one. You shouldn't. What you should need is a :* at the end, for the "tag" slot (see below). You need the first one because the string ":completion:" with colons at both ends is prefixed to $curcontext for style lookups. The context string always consists of a fixed set of fields, separated by colons and with a leading colon before the first. Fields which are not yet known are left empty, but the surrounding colons appear anyway. The fields are always in the order :completion:FUNCTION:COMPLETER:COMMAND:ARGUMENT:TAG. So in your zstyle above -- Lookup context Your pattern -------------- ------------ completion completion FUNCTION:COMPLETER * COMMAND zplugin ARGUMENT * TAG argument-rest I would have expected "argument-rest" to match the ARGUMENT position rather than the TAG position, so: zstyle ':completion:*:zplugin:argument-rest:*' list-colors \ '=(#b)(*)/(*)==1;35=1;33' What does ctl+x h (_complete_help) show if you use that instead of tab?