Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Color in completions
- X-seq: zsh-users 21214
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Color in completions
- Date: Sun, 31 Jan 2016 09:39:29 -0800
- 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==
- In-reply-to: <CAKc7PVAraFjBxoMhf=EpjPW+GnynDqCChKvzowt_g39C5Hibgg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDSZJ2ZijK1siwRA-8AV0H4ROeEyS26i5DWeFJT6SO24w@mail.gmail.com> <160129144546.ZM24675@torch.brasslantern.com> <CAKc7PVAraFjBxoMhf=EpjPW+GnynDqCChKvzowt_g39C5Hibgg@mail.gmail.com>
On Jan 31, 4:38pm, Sebastian Gniazdowski wrote:
} Subject: Re: Color in completions
}
} On 29 January 2016 at 23:45, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author