Since I've switched to Vim and made it my default editor by adding EDITOR="/usr/bin/vim" into my /etc/rc.conf, my shell (the great Z Shell) has started to misbehave.

After scratching my head and going really annoyed with why Ctrl+a didn't bring me to the beginning of the line and Ctrl+e to the end of it, but all hell broke loose and then the "delete" and "insert" keys started to change the case of the characters under the cursor and so on, I went to the #zsh channel on and asked.

Sure enough pretty soon someone told me that by changing the default text editor Zsh changes its default mode. So what was rendering my usage troublesome was that since I switched to Vim, Zsh switched to 'Vi' mode with the appropriate Vi-like bindings. The solution is simple – just adding bindkey -e to your ~/.zshrc switches the Zsh bindings back to the 'Emacs' mode.

Although I really like the separate modes in Vi(m) as the editor, in a shell I find it quite annoying. Maybe when (if) I become a Vim and Zsh master, it will make sense …until then I'm using Vim for editing and Zsh in 'Emacs' mode.

hook out → drinking the perfectly brewed cup of Darjeeling Himalaya FTGFOP and digging himself in his law books

Update: 2013-05-05: quite a while ago I actually switched to Vim mode in Zsh as well

Share on: TwitterFacebookEmail

Related Posts





Stay in Touch