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

Re: compctl help needed for IRC channel names



[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