zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: compctl help needed for IRC channel names
Date: Fri, 10 Nov 2017 15:15:10 -0800	[thread overview]
Message-ID: <171110151510.ZM16558@torch.brasslantern.com> (raw)
In-Reply-To: <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.


      reply	other threads:[~2017-11-10 23:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 21:13 Aleksandr Miroslav
2017-11-08  0:08 ` Aleksandr Miroslav
2017-11-10 22:42 ` Bart Schaefer
2017-11-10 23:15   ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=171110151510.ZM16558@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).