jeffreytse / zsh-vi-mode

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

Unable to remap `^s` to zsh binding #298

Open snikoletopoulos opened 1 month ago

snikoletopoulos commented 1 month ago

Unable to remap ^s to zsh binding

Basic examination

Problem description

I had a mapping to ^s. When loading ZVM I lose this binding.

I tried to use this function, but it didn't work

function zvm_after_lazy_keybindings() {
    zvm_define_widget pet-select

    bindkey '^s' pet-select
}

Reproduction steps

  1. Load this snippet to use pet in ^s
    pet-select() {
    BUFFER=$(pet search --query "$LBUFFER")
    CURSOR=$#BUFFER
    zle redisplay
    }
    zle -N pet-select
    stty -ixon
    bindkey '^s' pet-select
  2. Load ZVM
  3. Try pressing ^s. There is a text showing fwd-i-search: _ but not the pet snippet dialog.

pet is triggered and the dialog is shown.