zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: how to prevent $'command'<return> from changing the vi mode?
Date: Wed, 10 Apr 2013 11:11:42 -0700	[thread overview]
Message-ID: <130410111142.ZM7826@torch.brasslantern.com> (raw)
In-Reply-To: <CAMXWGTyQHMryXPooFbp6mzYd-8VeWMkf4EqYb0eF+W6G=WuOOA@mail.gmail.com>

On Apr 9,  9:52pm, Leonardo Barbosa wrote:
}
} I'm using vi mode in zsh. When i'm in normal mode and enter a command,
} for instance, $ls<return>, it enters in insert mode. I would like,
} however, to stay as  in the same mode as I was prior to hit <return>.
} How can i do that?

You need to look at the zle-line-init and zle-line-finish widgets.  You
can find several examples by going here:
    http://www.zsh.org/cgi-bin/mla/wilma/users
and searching for "zle-line-finish".

The idea is to save the mode in zle-line-finish and then restore the
saved mode (if there is one) in zle-line-init.  Just be sure you have
covered the case of not having saved a mode yet so that the first
prompt of a new shell is in the state you want.


      reply	other threads:[~2013-04-10 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  0:52 Leonardo Barbosa
2013-04-10 18:11 ` Bart Schaefer [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=130410111142.ZM7826@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).