Created
September 27, 2013 03:04
-
-
Save chrismccord/6723644 to your computer and use it in GitHub Desktop.
zsh vi mode status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim_ins_mode="[INS]" | |
vim_cmd_mode="[CMD]" | |
vim_mode=$vim_ins_mode | |
function zle-keymap-select { | |
vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}" | |
zle reset-prompt | |
} | |
zle -N zle-keymap-select | |
function zle-line-finish { | |
vim_mode=$vim_ins_mode | |
} | |
zle -N zle-line-finish | |
RPROMPT='${vim_mode}' | |
RPROMPT2='${vim_mode}' | |
setopt transient_rprompt # don't show command modes on previously accepted lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! Just created a new
zsh-vi-mode
plugin, don't you want to have a try?It's a totally very fresh release and maybe you'll like it, faster switching speed between normal mode and insert mode, and faster key response, bring you to real life, anyway welcome to be the early adopter, please upvote by commenting this post, many thanks for you (vimers).
https://github.com/jeffreytse/zsh-vi-mode
Features