From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: completion is over thinking things.
Date: Sun, 29 Sep 2019 09:44:20 -0700 [thread overview]
Message-ID: <CAH+w=7YAD=HCxgu2Lf9H0+XRhC22B3-4YpjJVBEUkujY73qKhw@mail.gmail.com> (raw)
In-Reply-To: <486df91b-8c6c-b129-2538-15e4d6126eb9@eastlink.ca>
On Sun, Sep 29, 2019 at 8:30 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> ... probably half of that stuff is redundant or useless or harmful or
> whatever and I don't even know where it came from.
"I don't know half of you half as well as I should like, and I like
less than half of you half as well as you deserve."
Really though, there's nothing bad or alarming in there. This is the
one you want to change:
> # Original: zstyle ':completion:*' completer _complete _match _approximate
> zstyle ':completion:*' completer _expand _complete
zstyle ':completion:*' completer _expand _complete _files
Note that this only makes completion fall back to _files when nothing
else matches; if _expand or _complete finds something, you won't get
file names. If you want file names all the time, mixed in with other
results, you'll have to write a custom function. The simplest such
function might look like:
_complete+files() {
_alternative 'normal::_complete' 'files::_files'
}
zstyle ':completion:*' completer _expand _complete+files
I would not recommend doing this unless you also keep using the
display configuration below (specifically the group-name style),
otherwise the way things get mixed together will be too confusing. As
written, this also has the drawback that even if _complete already
returns file names, _files will add them a second time anyway.
> # allow approximate
> #Tab completion should be case-insensitive.
> # Original: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
> zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
That's doing what the comment says, it makes completion
case-insensitive. It also allows dots, underscores, and hyphens to
fill themselves in.
> zstyle ':completion:*' auto-description 'specify: %d'
> zstyle ':completion:*' format 'Completing %d'
> zstyle ':completion:*' group-name ''
> zstyle ':completion:*' list-colors ''
> zstyle ':completion:*' list-prompt %SAt %p: Hit TAB 'for more', or the char to insert%s
> zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
Those are all about what the display looks like.
> zstyle ':completion:*' use-compctl false
That says not to fall back on the old built-in completions if the
compsys functions fail.
The rest of what you had is reasonably obvious, I think. The
kill-specific styles are from a zsh-users post a few years ago.
next prev parent reply other threads:[~2019-09-29 16:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-28 17:05 Ray Andrews
2019-09-28 17:13 ` Roman Perepelitsa
2019-09-28 17:36 ` Ray Andrews
2019-09-29 4:47 ` dana
2019-09-29 15:29 ` Ray Andrews
2019-09-29 16:44 ` Bart Schaefer [this message]
2019-09-29 18:41 ` Ray Andrews
2019-09-29 19:06 ` Bart Schaefer
2019-09-29 19:35 ` Ray Andrews
2019-09-29 13:09 ` Mikael Magnusson
2019-09-29 15:11 ` Ray Andrews
2019-09-29 15:19 ` Pier Paolo Grassi
2019-09-28 17:14 ` gmail
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7YAD=HCxgu2Lf9H0+XRhC22B3-4YpjJVBEUkujY73qKhw@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).