From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11475 invoked from network); 11 Mar 2004 13:00:38 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Mar 2004 13:00:38 -0000 Received: (qmail 16061 invoked by alias); 11 Mar 2004 13:00:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7138 Received: (qmail 16043 invoked from network); 11 Mar 2004 13:00:04 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Mar 2004 13:00:04 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.141.110.11] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Mar 2004 13:0:3 -0000 Received: from karnickel.franken.de (localhost [127.0.0.1]) by karnickel.franken.de (8.12.10/8.12.10) with ESMTP id i2BD015v088960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Mar 2004 14:00:02 +0100 (CET) Received: (from uucp@localhost) by karnickel.franken.de (8.12.10/8.12.2/Submit) with UUCP id i2BCtaUG088220; Thu, 11 Mar 2004 13:55:36 +0100 (CET) (envelope-from jean-luc@picard.franken.de) Received: by picard.franken.de (Postfix, from userid 1001) id A8F0811801D; Thu, 11 Mar 2004 13:55:58 +0100 (CET) Date: Thu, 11 Mar 2004 13:55:58 +0100 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: zzapper Cc: zsh-users@sunsite.dk Subject: Re: alias vl="vi !$" Message-ID: <20040311125558.GA24218@picard.franken.de> Mail-Followup-To: zzapper , zsh-users@sunsite.dk References: <4im0509toihq2ef1vlnnid6t93j90f6gor@4ax.com> <15272.1079008435@csr.com> <39n050dv0evle58451ugj2m1vfktsj1e1b@4ax.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ibTvN161/egqYuK8" Content-Disposition: inline In-Reply-To: <39n050dv0evle58451ugj2m1vfktsj1e1b@4ax.com> X-Operating-System: Linux X-Editor: VIM - Vi IMproved 6.2 http://www.vim.org/ X-IRC: tirc; Nick: tkoehler X-URL: http://jeanluc-picard.de/ User-Agent: Mutt/1.5.4i --ibTvN161/egqYuK8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, zzapper wrote: > On Thu, 11 Mar 2004 12:33:55 +0000, Peter Stephenson wrote: >=20 > On the command prompt line I'm often typing say >=20 > >ll fred.txt > >vi !$ >=20 > Now I'd like to have an alias/function called say vl (vi last) >=20 > >vl >=20 > Which would save me typing vi !$ (my poor little fingers!), for that > to work vl would need to access the line history accept-line-or-empty-cmd() { if [ "$LBUFFER$RBUFFER" =3D vl ] ; then LBUFFER=3D"vi !$" RBUFFER=3D"" fi builtin zle .accept-line } zle -N accept-line-or-empty-cmd bindkey "^M" accept-line-or-empty-cmd Fun with widgets :) Ciao, Thomas --=20 Thomas K=F6hler Email: jean-luc@picard.franken.de <>< WWW: http://jeanluc-picard.de IRC: tkoehler PGP public key available from Homepage! --ibTvN161/egqYuK8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFAUGHeTEYXWMJlHuYRAn/pAKCjqesiOL9ukbEnQl5tJBZTD7mhWwCfVW4d bASBd1ZBnDWETWRKvuzEpqs= =Rbs4 -----END PGP SIGNATURE----- --ibTvN161/egqYuK8--