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

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



This is already possible. The guys haven't read the manual.

zle-keymap-select () {
    if [ $KEYMAP = vicmd ]; then
        PROMPT="$(setPrompt ':')"
    else
        PROMPT="$(setPrompt '>')"
    fi
    zle reset-prompt
}
zle -N zle-keymap-select

This is my personal setup, but you can put in anything you want (obviously).
For the blinking-cursor-stuff you can use this:

zle-keymap-select () {
    if [ $KEYMAP = vicmd ]; then
        echo -en "\e[5 q"
    else
        echo -en "\e[1 q"
    fi
    zle reset-prompt
}
zle -N zle-keymap-select

-Nathan

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

--
/"\  ASCII Ribbon Campaign
\ /  - against HTML emails
 X   - against proprietory attachments
/ \  http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign



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