From: Alan <8fvebtoeq87@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: menu-select doesn't respect COMPLETE_IN_WORD option
Date: Wed, 10 Jun 2020 23:26:00 -0400 [thread overview]
Message-ID: <CAL7A0-PMSV6ZM5USa55mfH4=xaV0heCL7Uqe31B8RJxcgTBWjg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7aR_BjcWsfRZOtSas+r9zHphf12-2f=-C0CYZHZ4b3gCg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]
Yes, I've tried *not* setting the complete_in_word option, but then the
_prefix completer doesn't work. See this (rather bizarre in my opinion)
explanation from http://zsh.sourceforge.net/Guide/zshguide06.html:
"One gotcha with the _prefix completer: you have to make sure the option
COMPLETE_IN_WORD is set. That may sound counter-intuitive: after all,
_prefix forces completion *not* to complete inside a word. The point is
that without that option, completion is only ever tried at the end of the
word, so when you type <TAB> in the middle of <prefix><suffix>, the cursor
is moved to after the end of the suffix before the completion system has a
chance to see what's there, and hence the whole thing is regarded as a
prefix, with no suffix."
However, after reading that section on _prefix more carefully, I tried
putting the _prefix completer further up in my completer list right after
_expand (in ~/.zshrc) like so:
zstyle ':completion:*' completer _expand _prefix _complete _ignored _prefix
...and now it works (mostly) the way I prefer! Namely, it acts like
expand-or-complete-prefix and ignores the suffix, even if the suffix
matches something. There is still some weirdness with slashes at the end of
directories, so that I get double slashes sometimes when the suffix starts
with a slash, but I suppose that's something I can live with.
(I'm not actually entirely clear how the completer ordering works, so not
sure if I need that second _prefix instance at the end, but whatever works
I guess. If someone would care to shed some light on the matter, that would
be good too.)
On Wed, Jun 10, 2020 at 10:33 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:
> On Tue, Jun 9, 2020 at 7:26 PM Alan <8fvebtoeq87@gmail.com> wrote:
> >
> > I found a partial solution by adding the _prefix completer (along with
> the complete_in_word option).
>
> Have you tried NOT setting the complete_in_word option?
>
next prev parent reply other threads:[~2020-06-11 3:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 23:56 Alan
2020-06-10 1:11 ` Bart Schaefer
2020-06-10 1:53 ` Alan
2020-06-10 2:25 ` Alan
2020-06-11 2:33 ` Bart Schaefer
2020-06-11 3:26 ` Alan [this message]
2020-06-14 3:07 ` Bart Schaefer
2020-06-14 4:28 ` Alan
2020-06-15 0:37 ` Bart Schaefer
2020-06-15 5:09 ` Bart Schaefer
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='CAL7A0-PMSV6ZM5USa55mfH4=xaV0heCL7Uqe31B8RJxcgTBWjg@mail.gmail.com' \
--to=8fvebtoeq87@gmail.com \
--cc=schaefer@brasslantern.com \
--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).