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
- X-seq: zsh-workers 33990
- From: Nathan Schwarz <nathan@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Fwd: In Vi mode, show whether "insert" or "command" state is active
- Date: Wed, 17 Dec 2014 08:58:18 +0100
- In-reply-to: <CAN2X26=YUSe95T0aMHxTCccXAE7ZeZPBN2aR=4L_tssVxxJLSQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN2X26=YUSe95T0aMHxTCccXAE7ZeZPBN2aR=4L_tssVxxJLSQ@mail.gmail.com>
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