From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3581 invoked from network); 7 Jul 2005 19:10:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Jul 2005 19:10:27 -0000 Received: (qmail 1335 invoked from network); 7 Jul 2005 19:10:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Jul 2005 19:10:17 -0000 Received: (qmail 18762 invoked by alias); 7 Jul 2005 19:10:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9052 Received: (qmail 18752 invoked from network); 7 Jul 2005 19:10:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Jul 2005 19:10:10 -0000 Received: (qmail 400 invoked from network); 7 Jul 2005 19:10:10 -0000 Received: from karnickel.franken.de (193.141.110.11) by a.mx.sunsite.dk with SMTP; 7 Jul 2005 19:10:04 -0000 Received: from karnickel.franken.de (localhost [127.0.0.1]) by karnickel.franken.de (8.12.10/8.12.10) with ESMTP id j67JA14T065985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Jul 2005 21:10:02 +0200 (CEST) Received: (from uucp@localhost) by karnickel.franken.de (8.12.10/8.12.2/Submit) with UUCP id j67J1vNe063284 for zsh-users@sunsite.dk; Thu, 7 Jul 2005 21:01:57 +0200 (CEST) (envelope-from jean-luc@picard.franken.de) Received: by picard.franken.de (Postfix, from userid 1001) id CA30B4401C; Thu, 7 Jul 2005 21:00:49 +0200 (CEST) Date: Thu, 7 Jul 2005 21:00:49 +0200 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: zsh-users@sunsite.dk Subject: Re: Adding a prefix to certain filename completions Message-ID: <20050707190049.GA11877@picard.franken.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20050705080946.GC5333@puritan.pnetwork> <1050706050022.ZM13972@candle.brasslantern.com> <20050706113154.GA5313@puritan.pnetwork> <20050707020210.GA5084@puritan.pnetwork> <1050707054007.ZM14965@candle.brasslantern.com> <20050707105817.GA5452@puritan.pnetwork> <5826.1120735089@csr.com> <20050707121138.GC5452@puritan.pnetwork> <200507071254.j67CsHJh024834@news01.csr.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <200507071254.j67CsHJh024834@news01.csr.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 X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Peter Stephenson wrote: > Nikolai Weibull wrote: > > Ah, of course. There are many commands that can use this actually. > > :help ex gives the following list: > >=20 > > ex exim view gvim gex gview rvim rview rgvim rgview evim eview vimdiff = gvimdi > > ff > >=20 > > and, as you say, there's usually a vi link as well, >=20 > This adds the vim-specific versions. ex and view also come with vi. > I'll wait for someone to decide how to manage these three. >=20 > Index: Completion/Unix/Command/_vim > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_vim,v > retrieving revision 1.1 > diff -u -r1.1 _vim > --- Completion/Unix/Command/_vim 7 Jul 2005 11:16:11 -0000 1.1 > +++ Completion/Unix/Command/_vim 7 Jul 2005 12:51:01 -0000 > @@ -1,4 +1,4 @@ > -#compdef vim > +#compdef vim exim gvim gex gview rvim rview rgvim rgview evim eview vimd= iff gvimdiff > =20 > _vim_files () { > if [[ $(echo $PREFIX*(N)) =3D=3D '' ]]; then This whole discussion reminds me of some stuff that I always wanted to clean up a bit... My _vimhelp still depends on $VIM to be set (parsing "vim --version" output for vim's fallback for $VIM should be no problem), and removing sed out of the $vimversion calculation below could maybe also be done. Anyways... for those who think this might be useful: ----------------------- _vimhelp --------------------- #compdef vimhelp gvimhelp local vimversion curcontext=3D"$curcontext" context state line expl ret tag= sfile vimversion=3D$(vim --version |& head -1 | sed -e 's/VIM - Vi IMproved //' -= e 's/ .*//' -e 's/\.//' -e 's/^/vim/') tagsfile=3D$VIM/$vimversion/doc/tags _vimhelp_update_tags() { if (( ! $+_vimhelp_tags )); then _vimhelp_tags=3D( $(cat $tagsfile | sed -e 's/ .*//') ) fi } _vimhelp() { _vimhelp_update_tags compadd -- $_vimhelp_tags } _vimhelp "$@" ---------------------- / .zshrc -------------------- ----------------------- _vimhelp --------------------- vimhelp () { vim -c "help $1" -c on -c "au! VimEnter *" } gvimhelp () { gvim -c "help $1" -c on -c "au! VimEnter *" } ---------------------- / .zshrc -------------------- I was once thinking like vim -c "h =3D> vim -c "help =3D> vim -c "help Z =3D> vim -c "help ZZ" but then I just wrote my little vimhelp wrapper which was easier to do... Ciao, Thomas --=20 Thomas K=F6hler Email: jean-luc@picard.franken.de <>< WWW: http://gott-gehabt.de IRC: tkoehler PGP public key available from Homepage! --d6Gm4EdcadzBjdND 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) iD8DBQFCzXvhTEYXWMJlHuYRAtIbAJ970Vyh7KPWmb8+1z5Az1hT7in1AwCgnVHm a7SrDF+KJe9PsadFgLvQeRg= =LeWx -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--