Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to do a simple find-replace autocomplete?
- X-seq: zsh-users 11646
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: ahlgren@xxxxxxx
- Subject: Re: How to do a simple find-replace autocomplete?
- Date: Sun, 15 Jul 2007 21:20:16 -0700
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=hXbjxqkhzh2uKXstvcJawei5D9pTyN+8cFOHR41F7L85jAdI80xXGlp9+F7Dvmt8rmznXIE8YtRE6MJTaINVj2Rs0kL5VSodDvZzD5oQaBxHkbq5sRbSYlo0y/4xBc5vqbmanDCpg/IcZ1TuZLaV3Y0Zi0n06eO2U47xga8W4Y4=;
- In-reply-to: <200707152313.14642.mats_a@xxxxxxx>
- Mail-followup-to: ahlgren@xxxxxxx, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200707152136.40771.mats_a@xxxxxxx> <3442bf5a0707151933i47b9acfevfbc20c8dc178d0e6@xxxxxxxxxxxxxx> <200707152313.14642.mats_a@xxxxxxx>
On 2007-07-15 at 23:13 -0400, Mats Ahlgren wrote:
> How would one have the pattern "#dir" (perhaps defined via a regex) autocomplete using tab, invoking a script with the match (e.g. $ myAutoComp.py dir), which returns a newline-delimited list of possible completions to feed into the completion engine?
> This could be used in conjunction with a script which returns (from a hashmap) all directories N levels deep from your home directory -- saving lots of time if you're often looking for a uniquely-named subfolders.
> (sidenote: I'm more interested in the specific technique of interfacing with an outside script, rather than the end result.)
If you're using the standard ("new", a few years back) completion
system then all return values for any completion, in any context, are
returned by shell functions; there are many examples of completions
which come from calling a command and some of those use shell
associative arrays to cache the results.
Read through zshcompsys(1) for more information.
I guess doing something with _directories() is the way to go if you want
to change the concept of a directory for all tab-completion, but I'm not
very good with the completion system.
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author