Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: how to prevent $'command'<return> from changing the vi mode?



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.



Messages sorted by: Reverse Date, Date, Thread, Author