Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: In Vi mode, show whether "insert" or "command" state is active

On Fri, Dec 26, 2014 at 6:32 AM, Oliver Kiddle <okiddle@xxxxxxxxxxx> 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.


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.

Messages sorted by: Reverse Date, Date, Thread, Author