From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17716 invoked by alias); 25 Oct 2013 17:23:26 -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: 18059 Received: (qmail 28484 invoked from network); 25 Oct 2013 17:23:20 -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 From: Bart Schaefer Message-id: <131025102311.ZM9171@torch.brasslantern.com> Date: Fri, 25 Oct 2013 10:23:11 -0700 In-reply-to: Comments: In reply to Jesse Hathaway "Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?" (Oct 25, 10:50am) References: <131023064759.ZM9762@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: ZSH Users Mailing List Subject: Re: Duplicating TRANSIENT_RPROMPT for left PROPMT? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 25, 10:50am, Jesse Hathaway wrote: } } I tried the zle -M approach, but it seemed to result in my cursor sometimes } being at the bottom of the output, and them sometimes the vim_mode prompt } appearing, i.e. my cursor was jumping up and down. } } I ended up adding a preexec which solves the problem: } } # Clear vim_mode prompt before executing command, as the command output } will be } # written to same line as the vim_mode prompt on the terminal } function preexec { } echo -n "$terminfo[el]" } } Here's another possibility I should have thought of before: ---- 8< ---- PS1='%~ ' vim_ins_mode=$'\n'"-- INSERT --" vim_cmd_mode="" zle-keymap-select() { vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}" POSTDISPLAY=$vim_mode zle redisplay } zle -N zle-keymap-select zle -N zle-line-init zle-keymap-select zle-line-finish() { if [[ -n $POSTDISPLAY ]] then POSTDISPLAY='' zle redisplay fi } zle -N zle-line-finish ---- 8< ---- I think this solves all the problems so far discussed.