From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10829 invoked from network); 22 Jun 2006 10:36:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Jun 2006 10:36:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 60178 invoked from network); 22 Jun 2006 10:36:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jun 2006 10:36:41 -0000 Received: (qmail 8639 invoked by alias); 22 Jun 2006 10:36:35 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10409 Received: (qmail 8629 invoked from network); 22 Jun 2006 10:36:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jun 2006 10:36:34 -0000 Received: (qmail 58944 invoked from network); 22 Jun 2006 10:36:34 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by a.mx.sunsite.dk with SMTP; 22 Jun 2006 10:36:33 -0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FtMXy-0004JH-EA for zsh-users@sunsite.dk; Thu, 22 Jun 2006 12:36:26 +0200 Received: from 241.119-84-212.ippool.ndo.com ([212.84.119.241]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Jun 2006 12:36:26 +0200 Received: from david by 241.119-84-212.ippool.ndo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Jun 2006 12:36:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: zzapper Subject: Re: Accidently wrote a command in CAPS LOCK Date: Thu, 22 Jun 2006 10:36:10 +0000 (UTC) Organization: SuccessTheory Message-ID: References: <200606221025.k5MAPD8f010975@news01.csr.com> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 241.119-84-212.ippool.ndo.com User-Agent: Xnews/5.04.25 Sender: news Peter Stephenson wrote in news:200606221025.k5MAPD8f010975@news01.csr.com: > zzapper wrote: >> >> Accidently wrote a command in CAPS LOCK >> >> FTX SUCC BOOK >> >> What's the best way to lowercase this? > > Well, going to the start and using down-case-word (ESC l in Emacs > mode) until you get to the end is the obvious way. > > But it's not hard (after you've worked out the offsets, anyway) to > write a widget that transforms the region---I hadn't realised there > wasn't one: > > down-case-region() { > emulate -L zsh > integer p1 p2 > > if (( CURSOR < MARK )); then > (( p1=CURSOR+1, p2=MARK )) > else > (( p1=MARK+1, p2=CURSOR )) > fi > BUFFER[p1,p2]=${(L)BUFFER[p1,p2]} > } > zle -N down-case-region > > Unfortunately ${(L)...} and parameter indexing don't handle multibyte > characters yet, so down-case-word, which is implemented internally, > should be safer. You could use some kind of hybrid. > I was hoping for a history modifier eg ^^^ or !!:s/// but they don't seem to support wildcards? -- http://successtheory.com/tips/ Vim, Zsh, MySQL Tips