Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?
- X-seq: zsh-users 18056
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH Users Mailing List <zsh-users@xxxxxxx>
- Subject: Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?
- Date: Wed, 23 Oct 2013 06:47:59 -0700
- In-reply-to: <CANSNSoWkeU4GyV4qbd1TJEheX5gQ4=0mm-TwPPs+TNjHxyv4Qg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CANSNSoWkeU4GyV4qbd1TJEheX5gQ4=0mm-TwPPs+TNjHxyv4Qg@mail.gmail.com>
On Oct 22, 4:22pm, Jesse Hathaway wrote:
}
} The unusual part of my prompt is the vi mode at the bottom of my screen.
} Does anyone have thoughts on the best way to clear the prompt before the
} command is entered?
The best solution to this is to NOT put the vi mode in the prompt, but
instead use "zle -M" to display it. Simplest way is like this:
PS1='%~ '
vim_ins_mode="-- INSERT --"
vim_cmd_mode=""
function zle-keymap-select {
vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}"
zle -M -- "$vim_mode"
}
zle -N zle-keymap-select
zle -N zle-line-init zle-keymap-select
Of course if you're already doing other stuff in zle-line-init you'll need
to tweak this, e.g., call zle-keymap-select from zle-line-init.
This and your original scheme both seem to suffer from the problem that
any completion listing covers up the "mode message" and it doesn't return
until you toggle through command/insert again.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author