From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11578 invoked by alias); 7 Jun 2010 23:23:48 -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: 15099 Received: (qmail 15039 invoked from network); 7 Jun 2010 23:23:43 -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,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=8deTDzqE4tppvgBPMj9CHl2yGG9+La0q48Kxe+IsdyA=; b=VbDBS7RPJ3ZoGk+GWpGmKYfGC5GVelEwlvOwIfmo5EqbmMP3vQ0tAlYb6uOYVgQhNG hFGy6Or2EGD52iDTqvsDDi96Am7CFJo/ONTb9r+WNvob7k6DldWAHkDw4O+LtuAVCBot 6hmwZv6wP6mTrxYUiSrHcgtwZdDqDb/Zuff5A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ayawIZPTZRb3zmPdimJd8nN2Elx+TDPAj3J/QSzZcLlJTVIsnJUPzyuvBKPOH3x1u3 vZtOQdqgDD2rNPcHMUmmzl+UhFjeaV1+6TUn/9A38v9np2ZdWXADGM73rRQ+i/Bals8Y tpYJbk+PPpPNotC9Vjbfxk9He1PeYY5dutibg= MIME-Version: 1.0 Sender: 4wayned@gmail.com In-Reply-To: <20100605192316.GB26738@a-oben.org> References: <20100605192316.GB26738@a-oben.org> Date: Mon, 7 Jun 2010 16:23:38 -0700 X-Google-Sender-Auth: taUh6Ia7QE2PVx3MCvvvlMhvP9w Message-ID: Subject: Re: Assorted questions From: Wayne Davison To: Simon Friedberger Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=0016e65c78066c5954048878f6da --0016e65c78066c5954048878f6da Content-Type: text/plain; charset=UTF-8 On Sat, Jun 5, 2010 at 12:23 PM, Simon Friedberger > wrote: > Hello everybody, > > I'll just make a list with my questions. :) > > 1. Can I give background color to empty spaces. > I've adapted the example in the wiki at > http://zshwiki.org/home/examples/zlewidgets#vi_keys_-_show_mode > to show a different background color when in vi command mode. > You can see what I did here > https://simon.a-oben.org/blog/?p=233 > Just in case that the details matter. > > This approach has two problems. > a) The empty background isn't colored. This isn't really a > problem but it would be nice if it was. Is it possible? > b) I have a little smily in my prompt for return status 0 and > the return status for anything else. This is reset when I change > mode but it shouldn't. Any fixes? > > 2. I'm a fan of keeping things simple so I'm a bit irritaded by > some of the options. Maybe you can explain a good use-case to me. > a) accept-and-hold seems to be the same as ^p > b) history-search-back(for)ward and > history-beginning-search-back(for)ward > seem to be the same as ^r > I know that there is a subtle difference but I don't see > how it matters in practice. > > 3. The zle section of the guide suggests a binding with > bindkey -rpM viins '\e[' > to make unambiguous but I tried with $KEYTIMEOUT set to > something high and it doesn't seem to make a difference if I > have that binding or not. Can anybody suggest an experiment > where the difference shows? > > 4. I would like to have some history magic. It would be nice if > ^p/^n (or up/down) just switched through the local history but > ^r/^s searched through all history entries. Since I'm a touch typist, I almost alway use Ctrl-P and Ctrl-N to browse the history list, so I have them set to only visit local history. I then leave up-arrow and down-arrow set to browse the whole list (as does searching). Here's how I do it: bindkey '^p' up-line-or-local-history bindkey '^n' down-line-or-local-history up-line-or-local-history() { zle set-local-history 1 zle up-line-or-history zle set-local-history 0 } zle -N up-line-or-local-history down-line-or-local-history() { zle set-local-history 1 zle down-line-or-history zle set-local-history 0 } zle -N down-line-or-local-history Keep in mind that those fuctions assume that it is OK to set-local-history back to 0 -- if you don't normally toggle local history manually, then it should be fine. Someone who likes to use Up-arrow and Ctrl-P interchangeably could either bind those functions to the arrow keys, or you could set local history on by default and turn it off for the search functions. But keep in mind that you may want full-list searching for things like Esc-P (history-beginning-search-backward) too. For manually toggling shared history browsing: bindkey '^[/' set-local-history I used to have shared history set but it irks me that when a long > command finished I cannot just press up and change a paramter and run > it again. > That should not be the case. When you enter a command, zsh always imports all the shared lines first, and then appends your just-entered command last. That way any prior-line visitation is always to the command you just ran. If you entered no command, then it just slurps in new history lines, and thus the prior command could indeed be a non-local line (since there was no local line to follow the new ones). ..wayne.. --0016e65c78066c5954048878f6da--