Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compctl help needed for IRC channel names
- X-seq: zsh-users 22962
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: compctl help needed for IRC channel names
- Date: Fri, 10 Nov 2017 15:15:10 -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; bh=J0wYsXbxLa4evwo5kfzcXokXFWAVseVqLvX5EfWh35w=; b=IQe0puU6YPQgTz9GNNrmo9BZD6aGA/bVo/RNB77Kx7XJu7BijoaCD3IA/SFDP2Zsee EU4RBigJ1wL9/xC79ws8Hea7gvF784i7axbosQAEi6oRMKfVj0lYnsIl+aAmYjy2XNky RQA1cWXJ7qa5bfKeiaEiSiIm5c1FJonKjLIFN9oMHL0/y17IzfTnh1ty6E91R9qDLwVA o49KCWb3rv+HOuRDU1AWOdnsa3U1zBtVKxQyp9CbL86d7s4mR7d+57pw67YCwMG+eS7p uj9D2b/EMIq8sGAyVRdsSfIG7DyG+3YtjoYjc9V1TtRjgDUaKFeX+Lka+LGD2Rl7DuP9 nutw==
- In-reply-to: <171110144246.ZM16292@torch.brasslantern.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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CACcSE1xm8noE1p8mtR=jxhVjmOkkL=QwbLqtLGPW6urbj11gWQ@mail.gmail.com> <171110144246.ZM16292@torch.brasslantern.com>
[Oops, that got sent accidentally before I was finished.]
} } But, when I choose channel1 or whatever, it should return the full real
} } path (/path/network1/#channel1)
} }
} } How can I do this?
With compinit, you'd do something similar to the compctl solution that
you worked out, but it might be a bit simpler.
One thing you haven't told us is whether you want this to apply every
time you complete one of these file paths, no matter what the command
name might be, or whether this is specific to a particular command.
The approach might be somewhat different, depending.
With compinit, you define a list of functions via the "completer" style.
To generically perform your desired operation on file paths, you would
write a completer fuction and include it in the completer style at a
point you feel appropriate. For a particular command, you'd write a
function that generates the list of matches and associate it with the
command name by using "compdef".
If you're interested in following up on this approach, some more detail
about the context would be helpful.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author