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

Support expansion when in Vi mode #29

Closed
AtifChy opened this issue Nov 4, 2020 · 4 comments
Closed

Support expansion when in Vi mode #29

AtifChy opened this issue Nov 4, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@AtifChy
Copy link

AtifChy commented Nov 4, 2020

No description provided.

@olets olets changed the title doesn't work when vi mode is enabled on zsh Support expansion when in Vi mode Nov 4, 2020
@olets
Copy link
Owner

olets commented Nov 4, 2020

Tell me more about the behavior you'd expect? (Expansion of course, but should it still be space-triggered?) If we can figure out a good default I'd be happy to include it.

I don't use Vi(m) and don't have an intuition for how it should work. Adding this to your zshrc might good place to start if you want to experiment.

[edit in case anyone happens on this comment in the future: this was incorrect, the following declarations are not the fix]

bindkey -M vicmd " " _abbr_widget_expand_and_space
bindkey -M vicmd "^M" _abbr_widget_expand_and_accept
bindkey -M vicmd "^ " magic-space

@olets olets added in progress enhancement New feature or request and removed in progress labels Nov 4, 2020
@AtifChy
Copy link
Author

AtifChy commented Nov 5, 2020

It should behave normally in insert mode.

@olets
Copy link
Owner

olets commented Nov 7, 2020

bindkey -v is wiping out the zsh-abbr key bindings. zsh-abbr does not work if you initialize it before setting vi mode, and does work if you initialize it after setting vi mode.

The quickest way to test whether or not that's the problem for you is to run _abbr_bind_widgets.

If that enables abbreviation expansion in the current terminal, the final fix will depend on how you have things set up. If your .zshrc has bindkey -v or some vi mode plugin, move that above the point where you add zsh-abbr.

@olets
Copy link
Owner

olets commented Dec 15, 2020

That note 👆 is now in the readme. Closing due to lack of activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants