zsh-workers
 help / color / mirror / code / Atom feed
* Re: Fwd: In Vi mode, show whether "insert" or "command" state is active
@ 2014-12-22  0:07 Jason Spiro
  2014-12-22  1:57 ` Bart Schaefer
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Spiro @ 2014-12-22  0:07 UTC (permalink / raw)
  To: zsh-workers

On Wed, Dec 17, 2014 at 2:58 AM, Nathan Schwarz <nathan@notwhite.ro> wrote:

> This is already possible.

I know that it's already possible.  The feature request was not asking
you to make mode indication _possible_:  it was asking you to make it
please happen _by default_.  :)

You don't have to make it happen using a cursor change.  You can
choose whatever method you like.  May I suggest that you do things the
same way Bash's 'show-mode-in-prompt' feature does things:  add a
colon to the beginning of the prompt in vicmd mode; add a plus sign in
viins mode.

> For the blinking-cursor-stuff you can use this:
> [...]

Good to know; thank you.

> Ps: Sorry for double-sending Jason, I replied to you instead of replying to the ml.

No worries.

On Wed, Dec 17, 2014 at 1:27 PM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:

> However, you will need to ensure that the cursor is always reset when a
> line is accepted. Most reliable place to do that appears to be POSTEDIT:
>   POSTEDIT+=$'\e[2 q'

Thank you Oliver.


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: In Vi mode, show whether "insert" or "command" state is active
@ 2014-12-29  3:43 Jason Spiro
  0 siblings, 0 replies; 14+ messages in thread
From: Jason Spiro @ 2014-12-29  3:43 UTC (permalink / raw)
  To: Oliver Kiddle, ZyX, zsh-workers

On Fri, Dec 26, 2014 at 6:32 AM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> I'm not sure the keymap name is the most useful indicator for the vi
> mode. local keymaps are not going to be indicated and keymaps like
> menuselect have a longer name. Subtler indicators like cursor
> shape/colour or something like the readline feature are perhaps more
> useful. In vim, I would never read the '-- INSERT --' indicator: it is
> a blob that appears in peripheral vision.

Hmmm.

In viins mode, you could show a bright-white '-- INSERT --' indicator
somewhere on screen.  (Last line, like Vim?  First line?)  In vicmd
mode, you could hide the indicator.  This way, you could take
advantage of users' peripheral vision to make them aware of which mode
they're in.

Or you could indicate the mode using cursor color, like Emacs Viper
does.  In insert mode, turn the cursor green.  In command mode, turn
the cursor back to its normal color.

Or you could do both.

ZyX wrote:
> 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).

Other modes are so uncommonly used that you don't actually need to
bother identifying them.  (Optimize for the common case, not for
uncommon cases.)  But if you insist, you could change the '-- INSERT
--' indicator to '-- name_of_mode --' or something.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-12-29  3:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-22  0:07 Fwd: In Vi mode, show whether "insert" or "command" state is active 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
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

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).