jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.94k stars 102 forks source link

Switch to insert mode on focus #223

Closed smarquez1 closed 1 month ago

smarquez1 commented 1 year ago

General information

Please report the following information as possible as you can:

Basic examination

Problem description

Reproduction steps

  1. Switch to normal mode
  2. focus a different window or terminal
  3. Still be in Normal mode

Expected behavior

I'd like to have my terminals always switch to insert mode on focus. I tried using zvm_config but it onlly gets executed on init. Is there a way I can write a function that will programatically switch to insert mode on focus?

This is specially useful for me using tmux and executing scripts from vim or other terminals

smarquez1 commented 1 month ago

To answer me, this is what I do in my configuration:

function zvm_config() {
  ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
}
plug "jeffreytse/zsh-vi-mode"