zsh-workers
 help / color / mirror / code / Atom feed
From: ZyX <kp-pav@yandex.ru>
To: Jason Spiro <jasonspiro4@gmail.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: In Vi mode, show whether "insert" or "command" state is active
Date: Thu, 25 Dec 2014 23:34:43 +0300	[thread overview]
Message-ID: <1441071419539683@web21o.yandex.ru> (raw)
In-Reply-To: <CAN2X26n1+RJn95GhP4AQRKnHWgLVFLeW6JDVCgBPuE7eKT3JFA@mail.gmail.com>

25.12.2014, 07:16, "Jason Spiro" <jasonspiro4@gmail.com>:
> On Mon, Dec 22, 2014 at 1:44 PM, ZyX <kp-pav@yandex.ru> wrote:
>>  And this should be changed prompt/rprompt, not changing
>>  cursor because changing cursor shape is less likely to work
>
> OK.  You could do things the same way Bash's brand-new
> 'show-mode-in-prompt' feature does things:  you could add one extra
> character to the beginning of the prompt.  A colon in vicmd mode; a
> plus sign in viins mode.
>
> This should work reliably in every terminal emulator.

I have read that this is readline 6.3 feature that has nothing to do with bash except that bash is using readline. Also [vicmd]/[viins] variant is clearer then colon and plus and also in case of %z one should not assume only vicmd/viins: zle is not as limited as readline and theoretically allows any number of modes (have never seen them actually implemented though).

---

Also regarding %z minimal implementation: in my example code $KEYMAP is checked for being an alias to something. Most likely your variant will make %z disappear in `viins` mode (as it is linked to main and if I am not mistaking exiting vicmd will bring up the main keymap) and in my variant it definitely (I have tested this with `zsh -f`) will show either `vicmd` or `viins` effectively avoiding changing prompt width which may be confusing.


  reply	other threads:[~2014-12-25 20:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22  0:07 Fwd: " Jason Spiro
2014-12-22  1:57 ` Bart Schaefer
2014-12-22 18:25   ` Peter Stephenson
2014-12-22 18:44     ` Ray Andrews
2014-12-22 18:44   ` ZyX
2014-12-23  4:40     ` Bart Schaefer
2014-12-25  4:15     ` Jason Spiro
2014-12-25 20:34       ` ZyX [this message]
2014-12-25 23:18         ` Bart Schaefer
2014-12-26 11:32           ` Oliver Kiddle
2014-12-26 19:21             ` Bart Schaefer
2014-12-26 21:58               ` Christian Neukirchen
2014-12-27  0:31                 ` Bart Schaefer
2014-12-29  3:43 Jason Spiro

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=1441071419539683@web21o.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=jasonspiro4@gmail.com \
    --cc=zsh-workers@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).