From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11612 invoked from network); 24 Sep 2004 12:06:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Sep 2004 12:06:15 -0000 Received: (qmail 54535 invoked from network); 24 Sep 2004 12:06:09 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Sep 2004 12:06:09 -0000 Received: (qmail 27970 invoked by alias); 24 Sep 2004 12:05:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8019 Received: (qmail 27949 invoked from network); 24 Sep 2004 12:05:21 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Sep 2004 12:05:21 -0000 Received: (qmail 52578 invoked from network); 24 Sep 2004 12:04:22 -0000 Received: from main.gmane.org (80.91.229.2) by a.mx.sunsite.dk with SMTP; 24 Sep 2004 12:04:21 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CAooH-0002f6-00 for ; Fri, 24 Sep 2004 14:04:21 +0200 Received: from cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com ([80.3.247.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2004 14:04:21 +0200 Received: from david by cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2004 14:04:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: zzapper Subject: Re: Tip of the day: suspend-shell widget Date: Fri, 24 Sep 2004 13:04:15 +0100 Message-ID: <2838l0dbskm6ospea8p708vh0p276i53gq@4ax.com> References: <200409231044.i8NAiRFE013339@news01.csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com X-Newsreader: Forte Free Agent 2.0/32.652 Sender: news X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.5 required=6.0 tests=RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.5 On Thu, 23 Sep 2004 11:44:26 +0100, wrote: >I was rather to surprised to find the following zle widget works >seamlessly (at least with the latest version of zsh), but then I'm a >cynic. Save it as suspend-shell in your $fpath. > >Sample use: > >autoload suspend-shell >zle -N suspend-shell >bindkey '^z' suspend-shell > >^z now suspends the shell in the middle of the line editor. When you >bring it back to the foreground, you are exactly where you left off >editing. Obviously this is useless if the shell is running directly >in a terminal window, but detecting that is quite hard. > >Possibly worth adding to Functions/Zle? > > ># start of suspend-shell ># Suspend the shell in the middle of line editing. ># When you continue, it resumes exactly where you left off. ># Won't suspend a login shell unless you pass a numeric argument. > >if (( ${NUMERIC:-0} )); then > # "builtin" is in case someone decides to call this function suspend > builtin suspend -f >else > if [[ -o login ]]; then > zle -M "Can't suspend login shell (use numeric argument)" > return 1 > else > builtin suspend > fi >fi > >zle redisplay ># end of suspend-shell Peter, Is this for the case you're typing a command and think, yikes I need to check something else? Does it also apply to vi-mode? zzapper (vim, cygwin, wiki & zsh) -- vim -c ":%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg?" http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips