You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I commented on Reddit about this, but felt it also made sense to add here in case others would benefit from finding this in the future:
u/logicbus asks:
I'm new to Antidote and I'm trying to get zsh-history-substring-search working with it. I'm also using Zephyr. I looked through some discussions but about zsh-history-substring-search with Antidote but I'm wondering if those discussions are out of date now that Antidote hit 2.0.
Is there an explain-like-I'm-five version?
My answer:
zsh-users/zsh-history-substring-search (called HSS for the rest of this comment) is a bit of a pain for 2 main reasons which are detailed in the project's README.md:
It can conflict with other plugins like zsh-users/zsh-syntax-highlighting, so you need to load it in a certain order (ie: after syntax highlighting)
It's not very useful without the keybindings, and it frustratingly does't add them by default
Antidote is plugin agnostic, so it doesn't have any special handling built-in for any particular plugin's eccentricities, but it's not too tricky to set up. I use this plugin myself. Here's what you do:
First, in your ~/.zshrc define a function that sets up the keybindings before loading antidote:
# .zshrc
function hss-bindkey() {
zmodload zsh/terminfo
local keymap
for keymap in 'main' 'emacs' 'viins'; do
bindkey -M "$keymap" "$terminfo[kcuu1]" history-substring-search-up
bindkey -M "$keymap" "$terminfo[kcud1]" history-substring-search-down
done
}
# now load antidote
source /path/to/antidote.zsh
antidote load
Next, in your ~/.zsh_plugins.txt, include HSS and tell it to bind your keys after loading using the post:<FUNC> annotation:
# .zsh_plugins.txt
### ... load other plugins first with HSS near the bottom
zsh-users/zsh-history-substring-search post:hss-bindkey
That's my best ELI5 - hope that helps clears things up.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I commented on Reddit about this, but felt it also made sense to add here in case others would benefit from finding this in the future:
u/logicbus asks:
My answer:
zsh-users/zsh-history-substring-search(called HSS for the rest of this comment) is a bit of a pain for 2 main reasons which are detailed in the project's README.md:Antidote is plugin agnostic, so it doesn't have any special handling built-in for any particular plugin's eccentricities, but it's not too tricky to set up. I use this plugin myself. Here's what you do:
First, in your ~/.zshrc define a function that sets up the keybindings before loading antidote:
Next, in your ~/.zsh_plugins.txt, include HSS and tell it to bind your keys after loading using the
post:<FUNC>annotation:That's my best ELI5 - hope that helps clears things up.
Beta Was this translation helpful? Give feedback.
All reactions