Closed ghost closed 3 years ago
"up-line-or-beginning-search" and "down-line-or-beginning-search" are probably the widgets you are looking for. You can "bindkey" them in the same way as "history-substring-search-up" and "history-substring-search-down"
@guidovansteen thanks for the pointer, helping me out even though I know it's not really related to this repository.
It seems that up-line-or-beginning-search
and co. actually only match the very first word on the line, up to the first non-escaped space.
so
dotnet build
dotnet bin/Debug/netcoreapp2.2/MyProg.dll
dotnet build
dotnet bin<UP ARROW>
actually fills in dotnet build
instead of dotnet bin/Debug/netcoreapp2.2/MyProg.dll
.
You can simple remove the first star in the matching string, like this
local search_pattern="${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*"
This was also requested in #95 and #112, both of which also have accompanying PRs – #96 and #115, respectively.
Any thoughts from the maintainers? Seems to be a popular request. I had the same expectation after I found this plugin as I was migrating from oh-my-zsh.
Those PRs have been merged as of commit 4abed97b6e67eb5590b39bcd59080aa23192f25d. Please set the following configuration variable to enable this feature:
HISTORY_SUBSTRING_SEARCH_PREFIXED=1
@guidovansteen thanks for the pointer, helping me out even though I know it's not really related to this repository.
It seems that
up-line-or-beginning-search
and co. actually only match the very first word on the line, up to the first non-escaped space.so
dotnet build dotnet bin/Debug/netcoreapp2.2/MyProg.dll dotnet build dotnet bin<UP ARROW>
actually fills in
dotnet build
instead ofdotnet bin/Debug/netcoreapp2.2/MyProg.dll
.
i'm rewriting my zsh config without omz and i'm running into this. even though i've set:
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward
history-search-backward is only matching results that have the first command the same. so, with this history
ls /etc/
ls /usr/
ls /e<UP ARROW>
it changes to ls /usr
, and not the ls /etc/
i would expect.
if I type
py
and press up arrow I want to matchpython code.py
but notvim code.py
In this substring search,
vim code.py
obviously matches becausepy
is a substring ofvim code.py
I would like a simpler, start-only matcher.
Where does that exist?