1

In my normal use of Vim I have a key binding ("jj") to enter NORMAL mode. I accomplish this by setting a mapping configuration in ~/.vimrc -> :imap jk <Esc>. However this binding does not take effect in ZSH on Mac OS Terminal. Is there a way to enable this?

Edit/Update: I came across this question which appears to sort of indirectly answer my question within its question to something else (not its answer). Leaving this open as that original thread does not directly answer the question

Matt C.
  • 2,330
  • 3
  • 22
  • 26
  • Does this answer your question? [map jj to Esc in inputrc (readline)](https://stackoverflow.com/questions/6839006/map-jj-to-esc-in-inputrc-readline) – Friedrich May 26 '23 at 09:52

1 Answers1

1

ZSH and Vim are configured separately, in ~/.zshrc and ~/.vimrc respectively. You can add the jj key binding to your zsh terminal by adding the following line to you ~/.zshrc file.

# Add "jj" shortcut to enter NORMAL mode
bindkey -M viins 'jj' vi-cmd-mode
Matt C.
  • 2,330
  • 3
  • 22
  • 26