jeffreytse / zsh-vi-mode

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

zsh-vi-mode overwrites keybindings of oh-my-zsh plugins #127

Open cridemichel opened 3 years ago

cridemichel commented 3 years ago

General information

Basic examination

Problem description

zsh-vi-mode overwrites key bindings of oh-my-zsh plugins, such as fancy-ctrl-z

Reproduction steps

  1. install oh-my-zsh
  2. enable fancy-ctrl-z plugin
  3. CTRL-z does not work from terminal command line

Expected behavior

jeffreytse commented 3 years ago

Hi @cridemichel

Thanks for your reporting, and I will work on this as soon as possible.

Thanks and Regards

cridemichel commented 3 years ago

thank you for your prompt reply!

Cristiano De Michele @.***

Il giorno 25 set 2021, alle ore 19:59, JT @.***> ha scritto:

Hi @cridemichel https://github.com/cridemichel Thanks for your reporting, and I will work on this as soon as possible.

Thanks and Regards

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeffreytse/zsh-vi-mode/issues/127#issuecomment-927159768, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADU4YGW7SD6M5GVOOUNJ2TTUDYEWTANCNFSM5EXNUFKA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeffreytse commented 3 years ago

Hi @cridemichel

I have tested the fancy-ctrl-z plugin, but it works normally. Could you provide me some more details?

Thanks and Regards

cridemichel commented 3 years ago

Hi, with this minimalist .zshrc file: setopt HIST_FIND_NO_DUPS export PATH="/usr/local/opt/apr/bin:$PATH" export PATH="/usr/local/bin:/usr/local/sbin:$PATH" export ZSH="/Users/demichel/.oh-my-zsh" ZSH_THEME="agnoster" DISABLE_MAGIC_FUNCTIONS=true ENABLE_CORRECTION="true" plugins=(zsh-vi-mode fancy-ctrl-z) source $ZSH/oh-my-zsh.sh ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK ZVM_VI_SURROUND_BINDKEY="classic"

if I open vim and I type CTRL-z, vim goes in background as expected but if I re-type CTRL-z, I get just a C-z on the command line and it does not switch back to vim. zsh version is 5.8

best Cristiano

jeffreytse commented 3 years ago

Hi @cridemichel

Could you try this command bindkey -M viins | grep "\^Z", and paste the result to here?

Thanks and Regards

cridemichel commented 3 years ago

this is with zsh-vi-mode plugin loaded: ❯ bindkey -M viins | grep "\^Z" "^Z" self-insert otherwise I get: ❯ bindkey -M viins | grep "\^Z" "^Z" fancy-ctrl-z

jeffreytse commented 3 years ago

@cridemichel Now you have one solution to settle this issue, try the below code snippet:

# The plugin will auto execute this zvm_after_init function
function zvm_after_init() {
  zvm_bindkey viins '^Z' fancy-ctrl-z
}

I will take a further consideration on this issue except this solution.

morhekil commented 2 years ago

I had a similar issue related to marlonrichert/zsh-autocomplete plugin. It binds its search function to ^R, which got overwritten by zvm:

 % bindkey -M viins  | grep '"^R"'
"^R" fzf-history-widget

The workaround given above (rebinding ^R back to fzf-history-widget in zvm_after_init) fixed this for me as well.