From: Nathan Schwarz <nathan@notwhite.ro>
To: zsh-workers@zsh.org
Subject: Re: Fwd: In Vi mode, show whether "insert" or "command" state is active
Date: Wed, 17 Dec 2014 08:58:18 +0100 [thread overview]
Message-ID: <20141217075818.GA5675@Persephone> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2014-12-17 8:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 7:13 Jason Spiro
2014-12-17 7:58 ` Nathan Schwarz [this message]
2014-12-17 16:55 ` Bart Schaefer
2014-12-17 18:27 ` Oliver Kiddle
2014-12-17 8:23 ` Bart Schaefer
2014-12-22 0:07 Jason Spiro
2014-12-22 1:57 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141217075818.GA5675@Persephone \
--to=nathan@notwhite.ro \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).