Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSH widget doesn't work with VI mode #900

Open
LukasKnuth opened this issue Jun 17, 2024 · 2 comments
Open

ZSH widget doesn't work with VI mode #900

LukasKnuth opened this issue Jun 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@LukasKnuth
Copy link

Might be (probably is) related to #328

Describe the bug
The expected CTRL-G keymap does not do anything.

To Reproduce

  1. Setup ZSH (I'm also using oh-my-zsh)
  2. Install the https://github.com/jeffreytse/zsh-vi-mode plugin
  3. Run eval "$(navi widget zsh)" at the end of .zshrc
  4. Start console emulator (I'm using Alacritty)

Expected behavior
Pressing CTRL-G opens the Navi widget.

Versions:

  • OS: macOS 14.5 (23F79)
  • zsh 5.9 (x86_64-apple-darwin23.0)
  • navi 2.23.0

Additional context

  • When I run bindkey after everything is sourced, I can see that another command is bound to the ^g shortcut
  • When I run the eval line again manually once the shell accepts input, everything works as expected
  • If I remove the zsh-vi-mode plugin from my ZSH, everything works as expected

Speculation

What fixes this problem for me at the moment is setting the specific keymap when binding the key:

eval "$(navi widget zsh)"
bindkey -M viins '^g' _navi_widget

I think this happens because the zsh-vi-mode plugin changes the zsh input to VI mode. Perhaps this does not set a default keymap, so the command output by navi widget zsh (which doesn't specify a keymap) isn't added anywhere. The more specific command I added does override the binding as expected.

@LukasKnuth LukasKnuth added the bug Something isn't working label Jun 17, 2024
Copy link

welcome bot commented Jun 17, 2024

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

@Frestein
Copy link

function zvm_after_lazy_keybindings() {
	zvm_bindkey vicmd '^G' _navi_widget
}


function zvm_after_init() {
	zvm_bindkey viins '^G' _navi_widget
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants