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; 18+ 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] 18+ messages in thread
* Fwd: In Vi mode, show whether "insert" or "command" state is active
@ 2014-12-17  7:13 Jason Spiro
  2014-12-17  7:58 ` Nathan Schwarz
  2014-12-17  8:23 ` Bart Schaefer
  0 siblings, 2 replies; 18+ messages in thread
From: Jason Spiro @ 2014-12-17  7:13 UTC (permalink / raw)
  To: zsh-workers

Dear list,

Here is a feature request forwarded to you from the Debian bug
tracking system.  You may also view the feature request on the Web at
<http://bugs.debian.org/772985>.

Kind regards,
~Jason Spiro

---------- Forwarded message ----------
From: Debian Bug Tracking System <http://bugs.debian.org/772985>
Date: Fri, Dec 12, 2014
Subject: Bug#772985: In Vi mode, show whether "insert" or "command"
state is active

Package: zsh
Version: 4.3.17-1
Severity: wishlist

Zsh includes a Vi emulation feature.  This feature lets you use the Vi
keys at the zsh command prompt.  Zsh's Vi emulation includes a
"command mode" and an "insert mode".

Zsh's Vi emulation does not show the user which mode is active.  This
is frustrating and confusing.  (It's like an electric oven with no
indicator to show whether the oven is on or off.)

The current state-of-the-art Vi implementation is gVim, maintained by
Bram Moolenaar.  gVim provides a few indicators to tell you which mode
you're in.  One of these indicators is the cursor.  gVim uses a
blinking block cursor in command mode, and a blinking bar in insert
mode.

It would be very good if zsh, too, would show the user which mode was
active.  You can do this any way you like.  I would like it if you did
this by setting the cursor style, just as gVim does.

Here is how to set the cursor style (in supported terminals):

Set cursor to blinking bar:  echo -en "\e[5 q"
Set cursor to blinking block:  echo -en "\e[1 q"

The above commands definitely work in recent versions of iTerm2 (for
Mac OS) and xterm.  I haven't tested them in any other terminal
emulators.  Surely some terminal emulators do nothing at all in
response to the above control sequences.  Luckily, since Debian is
open source, their users can submit patches to fix this.

P.S.  Thank you very much for helping to maintain zsh.  It's perhaps
the most featureful shell out there, and I like it.

Kind regards,
~Jason Spiro

-- 
Bug#772985: http://bugs.debian.org/772985
Debian Bug Tracking System


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

end of thread, other threads:[~2014-12-27  0:31 UTC | newest]

Thread overview: 18+ 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
  -- strict thread matches above, loose matches on Subject: below --
2014-12-17  7:13 Fwd: " Jason Spiro
2014-12-17  7:58 ` Nathan Schwarz
2014-12-17 16:55   ` Bart Schaefer
2014-12-17 18:27     ` Oliver Kiddle
2014-12-17  8:23 ` Bart Schaefer

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