zsh-users / zsh-history-substring-search

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

How to install on Ubuntu 22.04 (in WSL2) without Oh My Zsh? #151

Closed tonyhomfray closed 7 months ago

tonyhomfray commented 10 months ago

I want to install zsh-history-substring-search on my Ubuntu 22.04 install in WSL2 (Windows 10) without using Oh My Zsh.

I have tried the following:

Installed the package from here (which installs correctly) https://software.opensuse.org/download.html?project=shells:zsh-users:zsh-history-substring-search&package=zsh-history-substring-search

Added the filepath to what I think is the correct location into my .zshrc file: source /usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh

Added key bindings to .zshrc

Restarted terminal

But when I type a previoius command (e.g. git) and press the up/down arrowa, it just cycles through my whole history, not that matching the command I typed.

Is is possible to install on Linux with OMZ? Are there instructions to do so?

Thanks!

DiogoHSS commented 7 months ago

Does the file exists in the directory its trying to source?

Mine is in /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

tonyhomfray commented 7 months ago

Thanks for getting back to me.

The file is at: ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

and my zshrc contains the line: source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

I've also tried it at: source /usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh

guidovansteen commented 7 months ago

Probably something is overriding your key bindings after "source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh" is run.

On Wed, 29 Nov 2023, 15:38 tonyhomfray, @.***> wrote:

Thanks for getting back to me.

The file is at:

~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

and my zshrc contains the line: source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh

I've also tried it at: source /usr/share/zsh-history-substring-search/zsh-history-substring-search.zsh

— Reply to this email directly, view it on GitHub https://github.com/zsh-users/zsh-history-substring-search/issues/151#issuecomment-1832021273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGH3YETH2CXSYUCFFCLGX3YG5CIDAVCNFSM6AAAAAA4OVTO6GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGAZDCMRXGM . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

tonyhomfray commented 7 months ago

Thanks. I'll have a look at that.

This is on a work laptop and my employer has recently given permission to replace Windows with Ubuntu, so I'll be doing a refresh install and setting ZSH up from scratch. With that in mind, I'm happy for this issue to be closed.

Thanks both for your support.