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 |
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
- Cursor movement (Navigation).
- Insert & Replace (Insert mode).
- Text Objects.
- Searching text.
- Undo, Redo, Cut, Copy, Paste, and Delete.
- Surrounds (Add, Replace, Delete, and Move Around).
- Switch keywords (Increase/Decrease Number, Boolean, etc. In progress).
- ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was all I needed
And that added a nice red
<<
to the front of my prompt when I am in command mode.I also prefer to put my ruby version and gemset in my RPROMPT so I'm happy with this more minimal solution.
Thanks!
Normal insert mode - http://cl.ly/RdoQ
Command mode - http://cl.ly/Rd7E