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

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

Bart wrote:
> Yes, I was only providing an example / starting point.  For this to work
> better we'd need another zleentry token or the like, to be able to query
> the keymap and state without requiring getsparam() calls and without the
> extra prompt redraw from inside zle-line-init.  Also keymap selection
> and possibly other state changes should always redraw the prompt (as an
> example, there currently is no hook when entering overwrite mode).

Do we really want the whole prompt redrawn? It's annoying if conditional
parts of the prompt evaluate differently causing it to change size.

With my current setup, I have a number of things setup to preserve this
state. So for example. with the return status I also need zle-line-init
to contain:
  typeset -g __prompt_status="$?"
And zle-keymap-select has:
  () {
    return $__prompt_status
  zle reset-prompt

Would a feature be somehow possible where a fixed set of characters are
marked for dynamic updating and made easy to update.

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.

I should mention that I'm all for making this simpler to configure.


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