From: Bart Schaefer <firstname.lastname@example.org>
To: Sebastian Gniazdowski <email@example.com>
Cc: Zsh hackers list <firstname.lastname@example.org>
Subject: Re: Complete global aliases?
Date: Sun, 18 Sep 2022 18:46:23 -0700 [thread overview]
Message-ID: <CAH+w=7b5uXvcZ851sfdia4f76LFRSP1EkwUOBQAV77q6P0wVog@mail.gmail.com> (raw)
On Sun, Sep 18, 2022 at 2:43 AM Sebastian Gniazdowski
> On Sun, 18 Sept 2022 at 01:27, Bart Schaefer <email@example.com> wrote:
>> Where would this fit in the overall design of contexts?
> I'm not sure, however there's a solution on the web, see: https://stackoverflow.com/a/59513051/11999858
That solution gives the user control over when global aliases are
completed, by adding a function that can be placed anywhere in the
completer zstyle. The suggested value of that zstyle happens to make
global aliases complete before anything else, but that doesn't answer
the question of how a default should work.
>> Do the aliases expand or is just their name completed?
> I think that only its name should be completed.
I'll note that theoretically the ^Xa key binding (expand aliases) can
be programmed to complete when a partial word matches an alias and
expand when a full word matches. I didn't attempt setting up the
necessary zstyle contexts.
>> What happens
>> if you complete to the right of a global alias that (if expanded)
>> changes the syntax of the command line
> I think that it shouldn't be expanded, so the issue isn't actual.
Upon further thought, I agree that it's not an issue for completion of
an alias itself. More generally, though, if the expansion of a global
alias contains ";" or "|" or "&&" or "||" etc., then ideally further
completions shouldn't be using the context of the preceding command
word. Unfortunately that requires checking every word to the left of
the cursor for a global alias, and expanding it, to get the "real"
next prev parent reply other threads:[~2022-09-19 1:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-17 14:20 Sebastian Gniazdowski
2022-09-17 23:27 ` Bart Schaefer
2022-09-18 9:43 ` Sebastian Gniazdowski
2022-09-19 1:46 ` Bart Schaefer [this message]
2022-09-24 11:02 ` Sebastian Gniazdowski
2022-09-18 2:11 ` Eric Cook
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).