zsh-users
 help / color / mirror / code / Atom feed
* how to prevent $'command'<return> from changing the vi mode?
@ 2013-04-10  0:52 Leonardo Barbosa
  2013-04-10 18:11 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Leonardo Barbosa @ 2013-04-10  0:52 UTC (permalink / raw)
  To: zsh-users

Hello all,

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?

Thanks in advance

Leo


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to prevent $'command'<return> from changing the vi mode?
  2013-04-10  0:52 how to prevent $'command'<return> from changing the vi mode? Leonardo Barbosa
@ 2013-04-10 18:11 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2013-04-10 18:11 UTC (permalink / raw)
  To: zsh-users

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-10 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-10  0:52 how to prevent $'command'<return> from changing the vi mode? Leonardo Barbosa
2013-04-10 18:11 ` Bart Schaefer

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).