-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
General information
- Terminal program: WezTerm 20240203-110809-5046fc22 (xterm-256color)
- Operating system: Linux (6.8.0-78-generic The cursor position does not go back one character after exiting the replace mode #78-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 12 11:34:18 UTC 2025 x86_64 GNU/Linux)
- ZSH framework: zinit v3.14.0-11-g04034e62 (linux-gnu_x86_64)
- ZSH version: zsh 5.9 (x86_64-ubuntu-linux-gnu)
- ZVM version: zsh-vi-mode 0.11.0
Basic examination
- [V] I have read through the README page
- [V] I have the latest version of zsh-vi-mode
- [V] I have tested with another terminal program
Problem description
bindkey in viopp doesn't work ZVM_LAZY_KEYBINDINGS set to false. if ZVM_LAZY_KEYBINDINGS is not set to false, then if i go to normal mode then load the bindkey, things work.
Reproduction steps
1. in .zshrc
function zvm_config() {
# Always start each new prompt in INSERT (optional but nice)
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
# IMPORTANT: use the ZLE engine so viopp bindings work reliably
ZVM_READKEY_ENGINE=$ZVM_READKEY_ENGINE_ZLE
}
function zvm_after_lazy_keybindings() {
zt light-mode for baodrate/vi-motions
}
ZVM_LAZY_KEYBINDINGS=false
zinit lucid light-mode for jeffreytse/zsh-vi-mode
2. create the file /tmp/test:
zvm_test_around() {
echo hi > /tmp/hi
}
zle -N zvm_test_around
for m in visual viopp; do
bindkey -M $m 'a/' zvm_test_around
done
3. start a new shell:
> . /tmp/test
> foo<esc>da/<ctrl-c>
> cat /tmp/hi
cat: /tmp/hi: No such file or directory
4. start a new shell:
> <esc>i. /tmp/test # that is, go to normal, then insert, then source the file
> foo<esc>da/<ctrl-c>
> cat /tmp/hi
cat: /tmp/hi: No such file or directory
5. comment out the ZVM_LAZY_KEYBINDINGS line in .zshrc
6. repeat 3 & 4 above -> same result
7. add this in .zshrc:
function zvm_after_lazy_keybindings() {
zinit light-mode for baodrate/vi-motions
}
8. repeat 3: same result
9. repeat 4: works!
10. uncomment the ZVM_LAZY_KEYBINDINGS line in .zshrc
11. repeat 3: same result
12. repeat 4: doesn't work
Expected behavior
seems like lazy loading vi-motions, when lazy keybingings are off makes binding work if going to normal mode first. this should not be the case. without lazy keybindings my keybindings should work without vi-motions and without going to normal mode first and with they should work without vi-motions
Everything works as expected if I don't load zsh-vi-mode and without vi-motions (so it's not something with zsh)
Metadata
Metadata
Assignees
Labels
No labels