From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1977 invoked from network); 7 Feb 2006 10:02:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Feb 2006 10:02:18 -0000 Received: (qmail 20885 invoked from network); 7 Feb 2006 10:02:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Feb 2006 10:02:12 -0000 Received: (qmail 4951 invoked by alias); 7 Feb 2006 10:02:01 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9885 Received: (qmail 4939 invoked from network); 7 Feb 2006 10:02:00 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Feb 2006 10:02:00 -0000 Received: (qmail 19848 invoked from network); 7 Feb 2006 10:01:59 -0000 Received: from sol.nlnetlabs.nl (213.154.224.43) by a.mx.sunsite.dk with SMTP; 7 Feb 2006 10:01:58 -0000 Received: from elektron.atoom.net (a80-127-17-126.adsl.xs4all.nl [80.127.17.126]) by sol.nlnetlabs.nl (Postfix) with ESMTP id B2D56188081 for ; Tue, 7 Feb 2006 11:01:57 +0100 (CET) Received: by elektron.atoom.net (Postfix, from userid 1000) id 2F94B5801A36; Tue, 7 Feb 2006 11:05:28 +0100 (CET) Date: Tue, 7 Feb 2006 11:05:28 +0100 From: Miek Gieben To: zsh users Subject: color change depending on vi mode Message-ID: <20060207100528.GB30436@miek.nl> Mail-Followup-To: zsh users Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline User-Agent: Vim/Mutt/Linux X-Home: www.miek.nl --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, In respons to: http://www.zsh.org/mla/users/2006/msg00042.html I've tweaked the vi-showmode file a little and I thought I might share this. I've only changed to top of the file if someone wants to receive the whole of this, please contact me off-list. regards, # [00:32|miekg@elektron ~] # ^ this pipe is changed when in normal/cmd mode # otherwise the | is plain go_up_left() { builtin echotc UP 1 builtin echotc LEFT $COLUMNS } go_down_left() { builtin echotc DOWN 1 builtin echotc LEFT $COLUMNS } show_mode() { local x local pos=6 x=$CURSOR # we do the vi thing in reverse, highlight something when # in cmd mode otherwise nothing case $1 in "NORMAL") go_up_left builtin echotc RIGHT $pos echo -n $'\e[0;37;44m'"|"$'\e[0m' CURSOR=$x go_down_left builtin echotc RIGHT $((x + 2)) # prompt ;; "INSERT") go_up_left builtin echotc RIGHT $pos echo -n "|" CURSOR=$x go_down_left builtin echotc RIGHT $((x + 2)) # prompt ;; esac } -- grtz, - Miek http://www.miek.nl http://www.nlnetlabs.nl PGP: 6A3C F450 6D4E 7C6B C23C F982 258B 85CF 3880 D0F6 --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFD6HDoJYuFzziA0PYRAkQTAKDVkXoRZ7EbQDVRAOYYz59pIDixUgCgnVfZ Ai3e+q6eOdt8Lv0JkizpmQc= =tNsA -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--