Zsh Mailing List Archive
Messages sorted by:
Re: Context-aware file name completion with preferences
- X-seq: zsh-users 15041
- From: Mikael Puhakka <mr.progo@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Context-aware file name completion with preferences
- Date: Sun, 2 May 2010 13:21:37 +0300
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uJ1yHC+Adn/bImvg1J3VYSKTh4R1J/OWD/oqWeSjj3k=; b=f3K/hq14TDyldMCrxlXtUDddykkUzwtSXtslLGMFy3zIa45UoIyY6/xi/weqT+m2ZS b+wmzJjohlwE2IXnzj2ACjfT9CKcAhP3wgWUT0x29IZgkXFbzKM4mfkQGyNUzfudtsfK /zmTM7bJa1Qj0vM/jJmKKEz0KRE1de6gTlEcM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=QqZZBqPU6FpMMZ1yEinZR+9WFmE7srBLyaSQ7zRuHXIcsVd7E53c8Q2ne7xfGh4Tih N01MpbiicWi7obgWRV7nB7Krw0GkpMZ6OaDBBnvDczAlpL1EpCHp20MaQknjVTRC40vG gN8aW6aVD6J23p/o43wMZf1Ke1Q1Lv1gBt/3o=
- In-reply-to: <r2i691a5d911005020216n48fed84ck4dad17ac306fd0cc@xxxxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <n2jd663d1bd1005010619l8468362al946bcda107870f95@xxxxxxxxxxxxxx> <t2z691a5d911005011327ud5958ddld67950ad59baf1cf@xxxxxxxxxxxxxx> <s2gd663d1bd1005011351xf00128bbjbc3dd2f41aeb822@xxxxxxxxxxxxxx> <r2i691a5d911005020216n48fed84ck4dad17ac306fd0cc@xxxxxxxxxxxxxx>
On Sun, May 2, 2010 at 12:16, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sat, May 1, 2010 at 1:51 PM, Mikael Puhakka <mr.progo@xxxxxxxxx> wrote:
>> Whoah! Thanks for a thorough explanation on how this works!
> You're welcome, but I can't really pretend that explanation was all
> that thorough. There's rather a lot of details I'm not going to try
> to write out ...
Yes, well I noticed that the explanation of yours doesn't actually
allow completing the other kinds of files. I adapted one example for
zstyle ':completion:*:(xpdf|epdfview|okular):*' file-patterns \
'*.(pdf|ps):readable-files *(-/):directories' '*:all-files'
Where I had to move directories to the first set of quotes. Using and
slightly modifying the set example it wouldn't allow me to complete
directories at all. I think this version doesn't cover the case
'*:all-files' at all either. For that particular example (pdf
reading/browsing) this is excellent, for the rest, I'll wait for the
Another good example of this kind of priority completion would be
video watching. For mplayer, I'd like to prefer extensions like "avi",
"mkv" etc. But not all videos have a common extension if not extension
at all! For instance, stream dumps can be without any specific name.
This is why I find important that zsh will also complete names that
aren't preferred, if there are no good choices. Your example pushed me
towards, however. And now I have something concrete to grep and find
in the manuals. The book will hopefully answer the rest.
>> Is there any other book recommendation for mastering zsh?
> No other book, but the online user guide may be helpful (don't let the
> 2003 date on the front page worry you, it has been updated a bit more
> recently than that).
This one is familiar. Perhaps not the clearest or simplest guide, (I
learned the basics of Zsh using the FAQ) but as a reference quite
good. The manpages are too enormous to be learned from! But being
references they work all along well.
Messages sorted by: