zsh-users
 help / color / mirror / code / Atom feed
From: Jesse Hathaway <jesse@mbuki-mvuki.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: ZSH Users Mailing List <zsh-users@zsh.org>
Subject: Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?
Date: Thu, 31 Oct 2013 13:01:50 -0500	[thread overview]
Message-ID: <CANSNSoVH4PtFHPcaRKQPJLw1e2F_X6czU-S9xSXCjGMMV3osgA@mail.gmail.com> (raw)
In-Reply-To: <131031080946.ZM9189@torch.brasslantern.com>

[-- Attachment #1: Type: text/plain, Size: 1763 bytes --]

On Thu, Oct 31, 2013 at 10:09 AM, Bart Schaefer
<schaefer@brasslantern.com>wrote:

> On Oct 31,  9:07am, Jesse Hathaway wrote:
> }
> } I tried grabbing the latest tarball from the website and compiling it,
> but
>
> I wouldn't have expected this to be a problem that would fix anyway ...


I thought it was a long shot, I just wanted to make sure debian had not
added some strange patch.

} the results are the same:
> }
> } ~| /usr/local/bin/zsh -x
> } +/home/jhathaway/.zshrc:1> PS1='%~ '
> } +/home/jhathaway/.zshrc:2> vim_ins_mode='
> } -- INSERT --'
> } +/home/jhathaway/.zshrc:3> vim_cmd_mode='
> } -- COMMAND --'
> } +/home/jhathaway/.zshrc:10> zle -N zle-keymap-select
> } +/home/jhathaway/.zshrc:11> zle -N zle-line-init zle-keymap-select
> } +/home/jhathaway/.zshrc:20> zle -N zle-line-finish
>
>
> Let's try "zsh -v" instead of "zsh -x" so we can see the function
> definitions.
>

~| /usr/local/bin/zsh -v
set -o vi
PS1='%~ '
vim_ins_mode=$'\n'"-- INSERT --"
vim_cmd_mode=$'\n'"-- COMMAND --"

zle-keymap-select() {
  vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}"
  POSTDISPLAY="$vim_mode $KEYMAP"
  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
~

Also, how are you choosing whether to be in vi mode or emacs mode?  The
> default is emacs mode, unless you have EDITOR=vi in the environment or
> something.
>

Using the EDITOR environment variable, I also tried setting it explicitly
with `set -o vi`

Try editing the zle-keymap-select function to put the actual keymap name
> into POSTDISPLAY, e.g.
>
>   POSTDISPLAY="$vim_mode $KEYMAP"


see above.

Thanks, Jesse

  reply	other threads:[~2013-10-31 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22 21:22 Jesse Hathaway
2013-10-23 13:47 ` Bart Schaefer
2013-10-25 15:50   ` Jesse Hathaway
2013-10-25 17:23     ` Bart Schaefer
2013-10-29 18:11       ` Jesse Hathaway
2013-10-30  6:19         ` Bart Schaefer
2013-10-30 18:01           ` Jesse Hathaway
2013-10-30 18:51             ` Bart Schaefer
2013-10-31 14:07               ` Jesse Hathaway
2013-10-31 15:09                 ` Bart Schaefer
2013-10-31 18:01                   ` Jesse Hathaway [this message]
2013-11-01  1:33                     ` Bart Schaefer
2013-11-01 20:10                       ` Jesse Hathaway

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=CANSNSoVH4PtFHPcaRKQPJLw1e2F_X6czU-S9xSXCjGMMV3osgA@mail.gmail.com \
    --to=jesse@mbuki-mvuki.org \
    --cc=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).