bindkey -v
is enough to enable vi mode in ZSH. If you are worried the setting will be overwritten by another plugin, put the setting at the bottom of your ~/.zshrc
.
After vi mode is enabled, you enter the “insert” mode by default. To enter “normal” mode, use Esc. And i or a to switch back to “insert” mode.
BTW, softmoth/zsh-vim-mode is the most powerful vim mode plugin I’ve ever used in ZSH.
Using bindkey -v
may take over functionality such as history search with control+R and control+S. To restore that particular behavior, add the following lines after bindkey -v
:
bindkey ^R history-incremental-search-backward
bindkey ^S history-incremental-search-forward
Other bindings can be found in the ZSH manual Standard Widgets section.