From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6991 invoked by alias); 4 Feb 2014 23:58:02 -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: 18394 Received: (qmail 10143 invoked from network); 4 Feb 2014 23:57:55 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1391557937; bh=Ei6niqEFmFEdvmCRM0ydRk9jX+EhC8LDjG+DZZTExq4=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=fyixWpshGWPQtBuewahU9ggdr0PQ3i2Usfgkc8ejwoVi2AMj0wfJQALD0JUrzij2219rpSB/WSpzHJh3p0VfWZxE/0h2/PTzIU5lKWksVjr8mScYqGdkC5O0DxxeTNjoyqKNIKUPKcD8qeemlBo56bqTZeuJwpV6y7v+AY+sSKg= X-Yahoo-Newman-Id: 369900.68280.bm@smtp132.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sQcVg20VM1nyi8UhLS.duhMom8oElDqkDAwOXfYtNPkDYM3 ZATnwZwLeawwCZYUa1.GyxtiJTOnhTXf0LbHOtg4WnCDIOHDuXeFVJ27QYTA 65UuI.uFKJ985ky2SVmeLSk3lmLlLnV4KKJNMUtCliy8YiYtkmf.z1QNYNw1 p58Z28bQkMAMgd_w5UfSocFv4e3QedKWUDT_j43G3ILSZrGDZJ0AP090kcvx QPxCCbVcCVOKRZmvhcbC5siSwx4lbcuQ1GXYq0DM0ITrSwzhbsdW0AX1ws86 W.6NE_Kbk9HfUFnnhZARgLPBP7BYbjTi6MpWvVeJ.t2k36lXMPb5c9yWVrCd 0iAYjFLc6XWy4stDr8P.3olaZdlA0GCoevVcc8Wdrsr0z5PBagRJ8SLraHLj HVTdcfEzeoKRk1QfAN85quAXT6O0vFvWpMPaQWxLsXEBmULnggnfhJddTtnz b0vxS5knhDiiGwDvewdQY0zXnDpqdcXnwzx8L2sViBjf4xMaKciHM6YA9Rfx 0sqSfuJZ2oB2qWSXt0YQ9FfZOA5Y- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@95.222.210.25 with plain [188.125.69.59]) by smtp132.mail.ir2.yahoo.com with SMTP; 04 Feb 2014 23:52:17 +0000 UTC In-reply-to: From: Oliver Kiddle References: To: zsh-users@zsh.org Subject: Re: Tab Expanding Global Aliases Date: Wed, 05 Feb 2014 00:52:16 +0100 Message-ID: <6788.1391557936@quattro> zzapper wrote: > I guess this must be an old chestnut for this NG. > But is there any reason why global aliases are not/could be tab expandable? With global aliases, it is always worth considering using bindkey -s instead. This expands the string immediately without needing a tab or space. So for example: bindkey -s 'Im' '| more' It is then more important to choose combinations that you won't really want to type. I used to prefix them with the ¬ that's on a UK keyboard but I don't use a UK keyboard anymore. An advantage of bindkey -s is that they can be used as abbreviations for things that appear in the middle of a string. Common glob qualifiers, for example: bindkey -s '\m' "(#qu$EUID)" bindkey -s '\p' '(../)##' Given how popular global aliases for piping to the pager are, I'm surprised we don't have a PIPENULLCMD. I'm guessing it is because the shell has always allowed you to continue on a new line after a pipe but maybe that isn't so important in an interactive shell. The following works. You can still use |\ if you want continuation. Can anyone foresee a problem with using it? Any ideas on improvements such as making the pager not appear in the history or on the terminal? zle-line-init () { local state=${(%):-%_} [[ $state = pipe && $PREBUFFER != *\\? ]] && zle -U $'less\n' } Oliver