zsh-users / zsh-history-substring-search

🐠 ZSH port of Fish history search (up arrow)
2.61k stars 156 forks source link

How to install manually (without Brew)? #126

Closed ovogel-wigital closed 2 years ago

ovogel-wigital commented 2 years ago

How do I install the plugin without Homebrew?

I tried to clone the repository and include the script to .zshrc. Like that:

1. Clone Repository

git clone https://github.com/zsh-users/zsh-history-substring-search.git ~/.zsh/plugins/zsh-history-substring-search

2. Source in .zshrc

source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

This does not seem to work. Did I miss something or is there any other way?

Any help would be greatly appreaciated.

guidovansteen commented 2 years ago

It works from the docker image zshusers/zsh. So, I guess the problem occurs somewhere on your side.

ovogel-wigital commented 2 years ago

Ok, thanks for the quick response. I will try again.

ovogel-wigital commented 2 years ago

FYI. The issue was a wrong key binding. Maybe it is OS releated. '^[[A' works on Mac OS but does not seem to work on Windows. I switched the binding to the suggested value and now it works.

bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down

bindkey "$terminfo[kcuu1]" history-substring-search-up bindkey "$terminfo[kcud1]" history-substring-search-down