Fix zsh vi mode cursor issues with tmux-resurrect

TL;DR

Add ZVM_INIT_MODE=sourcing to your .zshrc and restart tmux.

Explanation

When using the zsh Vim mode plugin zsh-vi-mode alongside tmux-resurrect, you might encounter a problem where the cursor is constantly displayed as a block. This can make it challenging to differentiate between normal mode and insert mode. The solution is straightforward, but identifying the cause of the issue can be a bit elusive. The zsh-vi-mode documentation states that:

In order to prevent various problems related to keybindings caused by the plugin sourcing sequence, and also keep the same functionality for this plugin, the initialization of this plugin was postponed to the first command line starting.
However, almost all plugins are initialized when the script is sourced. Therefore, this plugin provides an option ZVM_INIT_MODE to change the initialization mode.

To resolve this problem, change the initialization mode variable to sourcing by adding the following line to your ~/.zshrc and restart tmux:

ZVM_INIT_MODE=sourcing
2023 © Robin Wahlig