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-vi-mode breaks abbr auto expansions #303

Open
3 tasks done
devnoname120 opened this issue Nov 25, 2024 · 2 comments
Open
3 tasks done

zsh-vi-mode breaks abbr auto expansions #303

devnoname120 opened this issue Nov 25, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@devnoname120
Copy link

General information

The handy https://github.com/olets/zsh-abbr plugin enables the use of abbreviations, which are similar to aliases but they auto-expand when pressing space.

Whenever zsh-vi-mode is enabled it seems to override the bindkey " " abbr-expand-and-insert even in insert mode.

Related issues:

❯ neofetch
                    c.'          paul@Pauls-MacBook-Air
                 ,xNMM.          ----------------------
               .OMMMMo           OS: macOS Sonoma 14.7.1 (23H222) arm64
               lMM"              Host: MacBook Air (M1, 2020)
     .;loddo:.  .olloddol;.      Kernel: Darwin 23.6.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 16 hours, 24 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 4 (pipx), 267 (pip), 9 (npm), 387 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM:       Editor: VIM - Vi IMproved 9.1
:MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 2208x1242 @2x @ 60Hz, 1568x980 @2x @ 60Hz
.MMMMMMMMMMMMMMMMMMMMMMMMX.      DE: Aqua
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM: yabai
 'XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  'XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: MesloLGS-NF-Regular 13
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1 (8)
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1 (8)
       "cooc*"    "*coo'"        Memory: 13.36 GiB / 16.00 GiB (83%)
                                 Network: en0: Wi-Fi (802.11ax) @ 1080 Mbps
                                 Disk (/): 15G / 460G (57%)
                                 Locale: en_US.UTF-8
                                 Java: 20.0.2
                                 Node: 20.18.0

Basic examination

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

Problem description

zsh-vi-mode seems to override the bindkey " " abbr-expand-and-insert even in insert mode.

Reproduction steps

  1. Install https://github.com/olets/zsh-abbr
  2. Install https://github.com/jeffreytse/zsh-vi-mode
  3. Restart shell.
  4. Run abbr add abc=def.
  5. Type abc and then Space ␣.
  6. Nothing happens.

Expected behavior

The abc text is transformed to def right after pressing space. Removing zsh-vi-mode fixes it.

@jeffreytse jeffreytse self-assigned this Nov 25, 2024
@jeffreytse jeffreytse added the good first issue Good for newcomers label Nov 25, 2024
@jeffreytse
Copy link
Owner

Hi @devnoname120

Thanks for your detailed information. I've tried with the steps you provided, but I still can't reproduce the issue. Could you provide me your minimum .zshrc file to research the root cause? : )

Thanks & Regards

@bevicted
Copy link

==> Downloading olets/zsh-abbr
Cloning into '/Users/me/.local/share/zinit/plugins/olets---zsh-abbr'...
Cloning into '/Users/me/.local/share/zinit/plugins/olets---zsh-abbr/zsh-job-queue'...
⠏ ███████████ OBJ: 100, PACK: 0/52, COMPR: 100%, REC: 100%, RES: 100%
==> Compiling zsh-abbr.plugin.zsh [OK]
==> Installed 2 completions
❯ abbr add abc=def
Added the regular user abbreviation `abc`
❯ def

Works out of the box, installed via zinit, works both with and without ZVM_INIT_MODE=sourcing

I'm on macOS 15.1.1 (sequoia) using zsh 5.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants