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

Highlight lost when invoking zsh-history-substring-search #517

Closed
GordianDziwis opened this issue Nov 20, 2022 · 7 comments
Closed

Highlight lost when invoking zsh-history-substring-search #517

GordianDziwis opened this issue Nov 20, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@GordianDziwis
Copy link
Contributor

I am trying to get:
zdharma-continuum/fast-syntax-highlighting
zsh-users/zsh-history-substring-search
marlonrichert/zsh-autocomplete
to work together. Highlighting gets removed when doing a substring search.

Environment

ubuntu linux-gnu /usr/bin/zsh zsh ubuntu/5.8.1-1
/home/beavis/.zshrc:161
f07efda (grafted, HEAD -> main, origin/main, origin/HEAD) Don't omit comments from displayed history lines
gnome-terminal

Steps to reproduce

  1. Replace .zshrc with:
ZPLUGINDIR=$(mktemp -d)
# get zsh_unplugged and store it with your other plugins
if [[ ! -d $ZPLUGINDIR/zsh_unplugged ]]; then
  git clone --quiet https://github.com/mattmc3/zsh_unplugged $ZPLUGINDIR/zsh_unplugged
fi
source $ZPLUGINDIR/zsh_unplugged/zsh_unplugged.zsh
plugins=(
  zdharma-continuum/fast-syntax-highlighting
  zsh-users/zsh-history-substring-search
  marlonrichert/zsh-autocomplete
)
plugin-load $plugins

bindkey '^k' history-substring-search-up
bindkey '^j' history-substring-search-down
cd foo
cd ..
cd # press ^k and the highlight is lost.
@GordianDziwis GordianDziwis added the bug Something isn't working label Nov 20, 2022
@marlonrichert marlonrichert self-assigned this Nov 21, 2022
marlonrichert added a commit that referenced this issue Dec 12, 2022
@GordianDziwis
Copy link
Contributor Author

Works perfectly now, thanks a lot.

@kinland
Copy link

kinland commented Feb 27, 2023

There may have been a regression, but I'm not sure whether it's zsh-autocomplete or zsh-history-substring-search. I just filed an issue over there @ zsh-users/zsh-history-substring-search#145

Basically, these combinations of plugins work:

  • zsh-syntax-highlighting + zsh-history-substring-search
  • zsh-autosuggestions + zsh-syntax-highlighting + zsh-history-substring-search
  • zsh-autocomplete + zsh-autosuggestions + zsh-history-substring-search

But trying to use all 4 causes the zsh-history-substring-search highlight to disappear:- zsh-autocomplete + zsh-autosuggestions + zsh-syntax-highlighting + zsh-history-substring-search

Note that if I use zdharma-continuum/fast-syntax-highlighting instead of zsh-users/zsh-syntax-highlighting, then I can enable all 4 plugins with no issue.

@marlonrichert
Copy link
Owner

@dhorkin Can you check out the feature branch and see if it works correctly there?

@kinland
Copy link

kinland commented Feb 27, 2023

@dhorkin Can you check out the feature branch and see if it works correctly there?

feature branch doesn't appear to make a difference

@marlonrichert
Copy link
Owner

@dyhork I'm curious: Why do you even use zsh-history-substring-search, when Autocomplete already has this feature?

@kinland
Copy link

kinland commented May 2, 2023

@dyhork I'm curious: Why do you even use zsh-history-substring-search, when Autocomplete already has this feature?

The behavior is different, even if the end goals are similar. Depending on exactly what I'm trying to do, I will use one or the other

@marlonrichert
Copy link
Owner

How exactly does zsh-history-substring-search work differently? Wondering if I could let Autocomplete's history search cover the same use case.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants