jeffreytse / zsh-vi-mode

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

Use different widgets for 'i' and 'a' #89

Closed eleanor-clifford closed 3 years ago

eleanor-clifford commented 3 years ago

The current implementation of zvm_enter_insert_mode breaks if you don't use 'i' and 'a' to trigger it (which is a problem for me, as I use a non-standard keyboard). This PR replaces zvm_enter_insert_mode with zvm_enter_insert_mode_before and zvm_enter_insert_mode_after, for 'i' and 'a' respectively.

I'm aware that this will break functionality for anyone who has remapped or explicitly mapped zvm_enter_insert_mode, if you'd like we can leave the original implementation in, with a warning to change the remaps to the new functions.

jeffreytse commented 3 years ago

For now, we can settle this issue in below snippet:

# The plugin will auto execute this zvm_after_lazy_keybindings function
function zvm_after_init() {
  zvm_bindkey vicmd ';' zvm_enter_insert_mode i
  zvm_bindkey vicmd ':' zvm_enter_insert_mode a
}

And welcome to star this project for further updates in the future. : )

eleanor-clifford commented 3 years ago

Oh, i just saw that you fixed it on the latest commit in master, nevermind!