Zsh Mailing List Archive
Messages sorted by:
Re: How to do a simple find-replace autocomplete?
- X-seq: zsh-users 11645
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How to do a simple find-replace autocomplete?
- Date: Sun, 15 Jul 2007 21:11:44 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=dTNX719zgctfPdgAnqxXoVT511DKQAe/UtT0iTJPQO4uZ5j5NoggenO5Ne2tdAtRKtRsLu1BfDtowwCq5t7jN5rLw9PSBSI8huQm1k7pA/DcAESQYekZbukMdyDe+k3Mhne2LtP4y1RHn/FGdwL2j26vJ0FGFOHGVCyJorpHHe8=;
- In-reply-to: <3442bf5a0707151933i47b9acfevfbc20c8dc178d0e6@xxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200707152136.40771.mats_a@xxxxxxx> <3442bf5a0707151933i47b9acfevfbc20c8dc178d0e6@xxxxxxxxxxxxxx>
On 2007-07-15 at 19:33 -0700, Peter Mawhorter wrote:
> There may be a better way to do this tha's Zsh specific, but I've
> always just stuck a couple of variable declarations in my .zprofile:
> export $p=/home/pmawhorter/media/pictures
> and the like. When I type:
> cd $p<Tab>
> It completes to /home/pmawhorter/media/pictures.
> What is anoying is that I can't type '$p/a<Tab>' and complete directly
> to /home/pmawhorter/media/pictures/arrivals... I have to hit tab
> twice. Still, it's one way to "shortcut" directories.
% hash -d foo=~/bin/common
% less ~foo/<tab>
Without the / before the <tab>, the ~foo is expanded first.
This is just adding entries to the directory hash table, the same one
that by default auto-populates with users' home directories. (Which is
unwieldy when there's tens of thousands of users via LDAP and NFS
homedir automounts, so there's some hoops to jump through if you want to
artificially restrict it to a limited subset of users who are of
interest, but that's a whole different story).
Now, you can keep all the existing variables by just doing:
% setopt cdablevars
which will let you use ~p/ to mean the contents of $d/ but tying more
nicely into things like tab-completion.
Messages sorted by: