zsh-users
 help / color / mirror / code / Atom feed
From: Christopher Paul <Christopher.Paul@hitachivantara.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: RE: vi mode cursor position
Date: Mon, 15 Jul 2019 22:08:22 +0000	[thread overview]
Message-ID: <CY4PR08MB2437B44C7255EFEFB73B583BEDCF0@CY4PR08MB2437.namprd08.prod.outlook.com> (raw)
In-Reply-To: <41960-1563009868.475157@HUWd.vdv5.55oG>

Oliver Kiddle wrote:
 
> By default, k is bound to up-line-or-history.
> There are alternatives that differ in terms of the cursor position. For
> example:
> 
>   bindkey -a k history-beginning-search-backward

Thanks! This seems to work for me.

> However that may break other things like moving the cursor in a multi-line
> buffer so you may want to use a custom widget that does something like:

Hmm; I guess I'll know about that once I see it, but testing a multi-line buffer seems to work fine. I tested a multi-line buffer with:

echo "now is the time "\
> "for all good men"

>   if [[ $LBUFFER == *$'\n'* ]]; then
>     zle .up-line
>   else
>     zle .history-beginning-search-backward
>   fi

I put this in my .zshrc file and it didn't seem to change anything.

Thanks again, Oliver, I really appreciate your response.

CP

      reply	other threads:[~2019-07-15 22:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 23:52 Christopher Paul
2019-07-13  9:24 ` Oliver Kiddle
2019-07-15 22:08   ` Christopher Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR08MB2437B44C7255EFEFB73B583BEDCF0@CY4PR08MB2437.namprd08.prod.outlook.com \
    --to=christopher.paul@hitachivantara.com \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).