Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can't complete path with hidden .zfs?
- X-seq: zsh-users 22715
- From: lilydjwg <lilydjwg@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Can't complete path with hidden .zfs?
- Date: Thu, 25 May 2017 14:35:40 +0800
- Disposition-notification-to: lilydjwg@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:disposition-notification-to :user-agent; bh=vuOdGyaB4yWDJsFZHwZfyuMYvQwK4p97+8YNVB5mSfE=; b=R69puBJvCbYvHIyMVWhD7euJvLlJQMvU5GhaotDe6AiPeftXaCOFmR4pKaGwRbRQ8i XF2B3jqYO9asjw15FqwT778wlUYUcFi0ZqJfz5tvhVwGEO0arFDDZdI3zLhxXkM8X2LO vBMakHkAqbeLPX90SvPJQuz5Z/UIPx1BCgy104gKPrTXYoyoIF7YbJ9toudRiFcIPyyk x9EXrCY8z/gzpiuilHs8SWTiwtHQEqxjDMhVCv889JmAuNAK7PhzisUpSM3P4XlOz/mv ZZKV7NLWWK0eV3FO6lgx+Wo41XMIQ7Jn2vyhTmHXcyznfw+UcuV3acSMtsi/R0r2UMdy n6ZQ==
- In-reply-to: <170524120340.ZM15282@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20170518034638epcas3p184182faf0a2f6197f34386a052b7c856@epcas3p1.samsung.com> <20170518034452.GA22579@lilyforest.localdomain> <20170518100220.14cb480e@pwslap01u.europe.root.pri> <20170519033809.GA16150@lilyforest.localdomain> <20170519093052.1832023d@pwslap01u.europe.root.pri> <20170524104148.GA31624@lilyforest.localdomain> <170524120340.ZM15282@torch.brasslantern.com>
On Wed, May 24, 2017 at 12:03:40PM -0700, Bart Schaefer wrote:
> On May 24, 6:41pm, lilydjwg wrote:
> }
> } It'll be great if I can use a custom function to decide what to add, so
> } I can add .zfs only when it actually exists.
>
> There are two ways you can go here.
>
> If the .zfs mappings don't change very often, you can test at the time
> your .zshrc etc. are read and assign to fake-files at that time.
>
> On the other hand if either they change during your shell session or
> the check for them is very inexpensive, you can use "zstyle -e" to
> have a command executed every time the style is looked up.
Thanks you so much! I've got it to work perfectly now:
_get_zfs_fake_files () {
reply=($(awk -vOFS=: -vORS=' ' '$9 == "zfs" { print $5, ".zfs" }' /proc/self/mountinfo))
}
zstyle -e ':completion:*' fake-files _get_zfs_fake_files
They do change often, because some of them are on one of my external
hard drivers.
--
Best regards,
lilydjwg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author