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

Stop "prefixing" up/down arrow history search #7

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

vicnett
Copy link
Owner

@vicnett vicnett commented Nov 3, 2024

What

Stop matching history entries that don't start with the beginning of the search term.
For example, ls should match ls -l but not echo ls.

Why

For one, I'm used to it being this way. I also think it makes more sense this way. The only exception I can think of right now is sudo but, again, I'm used to how it works and I don't think that's an issue... If a command needs sudo I'll probably have sudo <command> typed before trying to look at what I typed last time I used that command.

How

The zsh-history-substring documentation explains that the HISTORY_SUBSTRING_SEARCH_PREFIXED variable is checked for being empty or non-empty, and it being non-empty results in the wanted behavior. The actual value doesn't matter so I just made it 'foo' 😄

@vicnett vicnett merged commit 4cf5acf into main Nov 3, 2024
1 check passed
@vicnett vicnett deleted the tweak-history-substring-search branch November 3, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant