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

Breaks history suggestions starting with a string #25

Closed
2 tasks done
gerazov opened this issue Jun 10, 2020 · 5 comments
Closed
2 tasks done

Breaks history suggestions starting with a string #25

gerazov opened this issue Jun 10, 2020 · 5 comments

Comments

@gerazov
Copy link

gerazov commented Jun 10, 2020

Great plugin 👍 It seems not to work well with autosuggestions though. Might be related to #8 but even ordering the plugins as suggested doesn't make it right.

These are two issues I have:

  • going word by word in the suggestion can be done using w in normal mode (although it flashes some annoying output), but going back using b doesn't deselect them.
    zsh_vim_autocomplete

  • if I start typing a command and try cycling through the autosuggestions using k it deletes what I typed and cycles through all commands.
    zsh_vim_backintime

My plugin list reads:

plugins=(
  git
  extract
  colored-man-pages
  zsh-interactive-cd
  zsh-autosuggestions
  zsh-syntax-highlighting
  zsh-vim-mode
  )
source $ZSH/oh-my-zsh.sh

VIM_MODE_ESC_PREFIXED_WANTED='bdfhul.g'  # Default is 'bdf.g'
@softmoth
Copy link
Owner

Thanks. I'll need to do some testing to see what specifically is conflicting, and probably look into how zsh-autosuggestions is implemented. Patches are welcome if anyone figures it out before I get to it!

@gerazov
Copy link
Author

gerazov commented Jun 16, 2020

This might be due to the way that zsh handles vim mode as it also happens when I set bindkey -v so I opened an issue there zsh-users/zsh-autosuggestions#545

@gerazov
Copy link
Author

gerazov commented Dec 17, 2020

In the related issue there was an answer by @meav that fixes the scrolling through the history using beginning search. I'm adding it here too - zsh-users/zsh-autosuggestions#545 (comment)

To reproduce just start typing a command in insert mode and then switch to vim mode and try scrolling for different autosuggestions and it simply scrolls from history ignoring the typed text. This also doesn't work when scrolling back with arrow keys in insert mode.
zsh_vim_backintime

This is not a bug, I solved this by add more key bindding in .zshrc:

bindkey -M vicmd "k" up-line-or-beginning-search
bindkey -M vicmd "j" down-line-or-beginning-search

@gerazov
Copy link
Author

gerazov commented Dec 17, 2020

I find that the first issue is a colouring quirk - up/down search works with the words up to the cursor even though those you backtrack through stay the same colour 👍

@softmoth
Copy link
Owner

Thank you, Branislav. I've added these keybindings if the respective ZLE widgets are defined. Hopefully that makes it Just Work for everyone.

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

No branches or pull requests

2 participants