Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?
- X-seq: zsh-users 18059
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH Users Mailing List <zsh-users@xxxxxxx>
- Subject: Re: Duplicating TRANSIENT_RPROMPT for left PROPMT?
- Date: Fri, 25 Oct 2013 10:23:11 -0700
- In-reply-to: <CANSNSoUB6pJ=6++7yL=2BUrYLyjDvZ7y6cDERfe_zYWtot9WHQ@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> <131023064759.ZM9762@torch.brasslantern.com> <CANSNSoUB6pJ=6++7yL=2BUrYLyjDvZ7y6cDERfe_zYWtot9WHQ@mail.gmail.com>
On Oct 25, 10:50am, Jesse Hathaway wrote:
}
} I tried the zle -M approach, but it seemed to result in my cursor sometimes
} being at the bottom of the output, and them sometimes the vim_mode prompt
} appearing, i.e. my cursor was jumping up and down.
}
} I ended up adding a preexec which solves the problem:
}
} # Clear vim_mode prompt before executing command, as the command output
} will be
} # written to same line as the vim_mode prompt on the terminal
} function preexec {
} echo -n "$terminfo[el]"
} }
Here's another possibility I should have thought of before:
---- 8< ----
PS1='%~ '
vim_ins_mode=$'\n'"-- INSERT --"
vim_cmd_mode=""
zle-keymap-select() {
vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}"
POSTDISPLAY=$vim_mode
zle redisplay
}
zle -N zle-keymap-select
zle -N zle-line-init zle-keymap-select
zle-line-finish() {
if [[ -n $POSTDISPLAY ]]
then
POSTDISPLAY=''
zle redisplay
fi
}
zle -N zle-line-finish
---- 8< ----
I think this solves all the problems so far discussed.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author