From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29623 invoked by alias); 27 Oct 2010 04:48:05 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15502 Received: (qmail 25255 invoked from network); 27 Oct 2010 04:47:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101026214742.ZM29753@torch.brasslantern.com> Date: Tue, 26 Oct 2010 21:47:42 -0700 In-reply-to: Comments: In reply to Eric Smith "Re: scratchpad text" (Oct 26, 7:43pm) References: <101025232913.ZM27636@torch.brasslantern.com> <101026081643.ZM28648@torch.brasslantern.com> In-reply-to: Comments: In reply to Eric Smith "Re: scratchpad text" (Oct 26, 7:50pm) X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: scratchpad text MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 26, 7:43pm, Eric Smith wrote: } } > Replace sc/rc with tsl/fsl to use the status line if your terminal has } > one (which you can test for by examining $terminfo[hs]). } } [eric@pepper ~] $ echo $terminfo[hs] } no } } How would I change this? Use a different terminal emulator ... On Oct 26, 7:50pm, Eric Smith wrote: } } Getting greedy now: } May we have colours? } } And a nice easy way to recall the scratchpad text to edit at will. Well ... combining this with my previous suggestion ... autoload -Uz sticky-note zle -N sticky-note sticky-note -b zle-line-init() { local STICKYFILE=${STICKYFILE:-$HOME/.zsticky} local STICKYSIZE=${STICKYSIZE:-1000} if [[ -n "$STICKYFILE" && -s "$STICKYFILE" ]] then fc -ap $STICKYFILE $STICKYSIZE $STICKYSIZE print -nr "$terminfo[sc]$terminfo[home]" print -nr "$bg[yellow]$fg[black]" print -n -- "$(fc -n -l -1)" print -nr "$reset_color$terminfo[rc]" fi } zle -N zle-line-init The print -n -- "$(fc ...)" is there to convert e.g. "\n" in the stored history into a real newline in the display. I may need to fix that in sticky-note itself. You can pick your own keybinding to invoke sticky-note as a widget, e.g. bindkey ^X^Y sticky-note You can then move up and down through previous notes to edit.