up vote 4 down vote favorite
5
share [g+] share [fb]

Ok, so I finally made the great change. In my .zshenv, I changed my EDITOR:

export EDITOR=vim

There are a couple of questions I have that are so minor that I didn't want to start separate questions for them. Here they are:

  1. How do I get zsh to distinguish between insert mode and command mode like in vim? Preferably this would change the cursor from an underline to a block like in vim, but displaying text at the bottom would work as well.

  2. How do I get it to act more like vim? For instance, I'd rather it be in command mode by default and not go out of it after one command.

link|improve this question

80% accept rate
feedback

2 Answers

up vote 4 down vote accepted

1.) (see http://zshwiki.org/home/examples/zlewidgets and http://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/ ):

function zle-line-init zle-keymap-select {
    RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
    RPS2=$RPS1
    zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select

Where:

2.) i suspect that you have to write another zsh-widget to do that, get inspired by the first of the two links for the first problem.

link|improve this answer
feedback
zle-line-init() { zle -K vicmd; }
zle -N zle-line-init

these two lines make sure it starts in command mode

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.