From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2053 invoked by alias); 8 Jan 2013 17:13:12 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17538 Received: (qmail 20943 invoked from network); 8 Jan 2013 17:13:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at hack.org does not designate permitted sender hosts) Date: Tue, 8 Jan 2013 18:01:45 +0100 From: Daniel To: Oliver Kiddle Cc: "zsh-users@zsh.org" Subject: Re: completer that first expands global aliases (Re: dsf) Message-ID: <20130108170145.GA4762@kelebek.lublin.se> References: <1357650387.9070.YahooMailNeo@web171903.mail.ir2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1357650387.9070.YahooMailNeo@web171903.mail.ir2.yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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...?