From: Daniel <quite@hack.org>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: completer that first expands global aliases (Re: dsf)
Date: Tue, 8 Jan 2013 18:01:45 +0100 [thread overview]
Message-ID: <20130108170145.GA4762@kelebek.lublin.se> (raw)
In-Reply-To: <1357650387.9070.YahooMailNeo@web171903.mail.ir2.yahoo.com>
Thanks for your time, this is all a bit above me, and perhaps I should learn
more about zle and all to deserve the fancy and particular things I want...
> You can insert _expand_alias before _files in the list of completer
> functions. I'm not sure if that works in the way you want: a global
> alias will simply be expanded. If you tried that and it didn't work then
> I would suspect that your default completer style is getting precedence
> over this one. Try using more colons instead of a *:
Yes, it just expands the global alias, and then quits (?!). I would like it to
first expand, and then proceed with matching, or whatever it should do.
I have a couple of global aliases for directories:
alias -g DL="~/dl/"
I tried out your most-recent-* and it seems fine and more robust. I can't get
it to work the way I want though.
> zstyle ':completion:most-recent-*::::' completer _menu _complete _match
If I add the _expand_alias like below, hitting ^Xm gives the expansion with a
trailing space. And nothing more happens. The hash is the cursor position:
zstyle ':completion:most-recent-*::::' completer _expand_alias _menu _complete _match
$ cat ~/dl/ #
And if I add it after _menu, I get the expansion without a trailing space.
Hitting ^Xm again then sure enough gives me the newest file in "DL".
zstyle ':completion:most-recent-*::::' completer _menu _expand_alias _complete _match
$ cat ~/dl/#
Maybe the problem is related to alias expansion being inherently based on
words, and will typically expand with a trailing space. Is these directory
shortcuts I want a reasonable use of global aliases, or do I want something
else...?
next prev parent reply other threads:[~2013-01-08 17:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 10:01 dsf Daniel
2013-01-08 9:41 ` completer that first expands global aliases (Re: dsf) Daniel
2013-01-08 9:58 ` Peter Stephenson
2013-01-08 13:06 ` Oliver Kiddle
2013-01-08 17:01 ` Daniel [this message]
2013-01-08 18:24 ` Bart Schaefer
2013-01-08 21:29 ` Daniel
2013-01-09 4:40 ` Bart Schaefer
2013-01-09 7:29 ` Daniel
2013-01-09 16:05 ` 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=20130108170145.GA4762@kelebek.lublin.se \
--to=quite@hack.org \
--cc=okiddle@yahoo.co.uk \
--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).