From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2838 invoked by alias); 10 Apr 2013 18:11:54 -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: 17755 Received: (qmail 6839 invoked from network); 10 Apr 2013 18:11:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130410111142.ZM7826@torch.brasslantern.com> Date: Wed, 10 Apr 2013 11:11:42 -0700 In-reply-to: Comments: In reply to Leonardo Barbosa "how to prevent $'command' from changing the vi mode?" (Apr 9, 9:52pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: how to prevent $'command' from changing the vi mode? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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, it enters in insert mode. I would like, } however, to stay as in the same mode as I was prior to hit . } 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.