zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

`jk` escape sequence and custom widget key binding issues

Open volodymyrprokopyuk opened this issue 1 year ago • 1 comments

General information

  • Terminal program: wezterm 20230326-111934-3666303c
  • Operating system: Manjaro Linux 6.1.25-1
  • ZSH framework: zinit v3.10.0-15-g6d84f999 (linux-gnu_x86_64)
  • ZSH version: zsh 5.9 (x86_64-pc-linux-gnu)
  • ZVM version: 0.9.0 (the latest zvm version installed with zinit at the time of issue creation)

Basic examination

  • [x] I have read through the README page
  • [x] I have the latest version of zsh-vi-mode
  • [ ] I have tested with another terminal program

Problem description

  • The jk escape key binding does not work while the Esc works. I tried
    function zvm_config {
      ZVM_VI_ESCAPE_BINDKEY=jk
    }
    
  • The Ctrl-o key binding for opening files with the xdg-open stopped to work after installing the zsh-vi-mode
    • Initial working configuration before installing the zsh-vi-mode
      function fzf_open_file {
        local file
        { file="$(fzf)" && [ -f "$file" ] && xdg-open "$file" &> /dev/null } </dev/tty
      }
      zle -N fzf_open_file
      bindkey '^o' fzf_open_file
      
    • I tried
      function zvm_after_lazy_keybindings {
        zvm_bindkey vicmd '^[,' autosuggest-accept
        zvm_define_widget fzf_open_file
        zvm_bindkey vicmd '^o' fzf_open_file
      }
      
  • How the Alt-, key binding for autosuggest-accept can be also bound in all modes (specifically the insert mode)?. I managed to bind Alt-, only in normal mode with zvm_bindkey vicmd '^[,' autosuggest-accept
  • How the Ctrl-g can be bound in all modes to what Ctrl-c is currently bound?

Reproduction steps

  1. Use the provided below my zsh-vi-mode configuration
  2. For wide context my .zshrc is at https://github.com/volodymyrprokopyuk/dotfiles/blob/master/.zshrc
  3. The above described issues can be experimented

My zsh-vi-mode configuration

function zvm_config {
  ZVM_VI_ESCAPE_BINDKEY=jk
}
function zvm_after_init {
  fzf_config
}
function zvm_after_lazy_keybindings {
  zvm_bindkey vicmd '^[,' autosuggest-accept
  zvm_define_widget fzf_open_file
  zvm_bindkey vicmd '^o' fzf_open_file
}
zinit light jeffreytse/zsh-vi-mode

Expected behavior

The jk, Ctrl-o, and hopefully Alt-, and Ctrl-g in all modes should work.

Thank you very much for the great plugin! It is very useful!

volodymyrprokopyuk avatar Apr 25 '23 11:04 volodymyrprokopyuk