Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: accept-exact and current directory
- X-seq: zsh-users 20553
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: accept-exact and current directory
- Date: Sun, 13 Sep 2015 13:49:41 -0700
- In-reply-to: <CABZhJg_Qa62ZM=kKmDiHe-yGybUzx4pyn3dyb8w5j0bn9AU58w@mail.gmail.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: <CABZhJg_Qa62ZM=kKmDiHe-yGybUzx4pyn3dyb8w5j0bn9AU58w@mail.gmail.com>
On Sep 13, 8:12pm, Jesper Nygards wrote:
}
} zstyle ':completion:*' accept-exact true
}
} ls ~/.<tab>
}
} Now, since accept-exact is active, zsh assumes that I mean '.' for current
} directory, and completes with:
}
} ls ~/./
}
} Is there some way to specify that I never want '.' to match, as in the path
} above and similar cases?
The doc for accept-exact says:
When completing pathnames (where the tag used is `paths') this
style accepts any number of patterns as the value in addition to
the boolean values. Pathnames matching one of these patterns will
be accepted immediately even if the command line contains some
more partially typed pathname components and these match no file
under the directory accepted.
The part about "... even if ... these match no file" is a little confusing,
and in fact I can't come up with a case where it applies. Maybe PWS or
Oliver can disentangle Sven's non-native English here. Anyway, the point
is to come up with patterns that don't match a trailing dot:
zstyle ':completion:*:paths' accept-exact '[^.]' '^(*/.)'
(remember these are string-match patterns, not globs, although they
share syntax, and that completion always uses extendedglob, so ^(*/.)
to strings not matching */.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author