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

Is it possible to filter continuous and repeated history records? #129

Closed
zitn opened this issue Nov 19, 2020 · 8 comments
Closed

Is it possible to filter continuous and repeated history records? #129

zitn opened this issue Nov 19, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@zitn
Copy link

zitn commented Nov 19, 2020

What do you want?

could you add an option to filter out continuous and repeated history records?

Why do you want this?

Sometimes I will use a lot of the same commands repeatedly, which makes it difficult to find the history records I want.

Who else would benefit from this?

Other people who use repeated commands a lot, I think.

@zitn zitn added the enhancement New feature or request label Nov 19, 2020
@marlonrichert
Copy link
Owner

Zsh itself has various options for that:

  • HIST_FIND_NO_DUPS: When searching for history entries in the line editor, do not display duplicates of a line previously found, even if the duplicates are not contiguous.
  • HIST_IGNORE_ALL_DUPS: If a new command line being added to the history list duplicates an older one, the older command is removed from the list (even if it is not the previous event).

@marlonrichert marlonrichert added Discussion and removed enhancement New feature or request labels Jan 19, 2021
@thekip
Copy link

thekip commented Feb 26, 2021

@marlonrichert could you elaborate a bit how using this options hide this duplicates?

image

I tried to add setopt HIST_FIND_NO_DUPS to my .zhrc and then source ~/.zshrc but still see a lot of duplicates in search. Sorry if it's a stupid question, I'm a complete newbie in all these things

@marlonrichert
Copy link
Owner

marlonrichert commented Feb 26, 2021

You're right, that option doesn't seem to work here. I'll see if I can change the code to respect it.

@marlonrichert marlonrichert reopened this Feb 26, 2021
@thekip
Copy link

thekip commented Mar 2, 2021

Moreover now it shows one command in the list, but pick up different command when you navigate to it.

screencast 2021-03-02 08-41-30

@marlonrichert marlonrichert added the enhancement New feature or request label Mar 4, 2021
@marlonrichert marlonrichert self-assigned this Mar 8, 2021
@marlonrichert marlonrichert added good first issue Good for newcomers help wanted Extra attention is needed labels Mar 11, 2021
@GabrielDeml
Copy link

Could you point me in the direction of where this bug would be? I have been having the same problem and would like to fix it. Starting next Thursday I will have a couple days off from school so at least I could take a shot at fixing it.

@marlonrichert
Copy link
Owner

marlonrichert commented Mar 14, 2021

@GabrielDeml Sure thing. You can find the code in question here: https://github.com/marlonrichert/zsh-autocomplete/blob/main/completion/_autocomplete.history_lines

Let me know if you have any questions.

@marlonrichert marlonrichert removed their assignment Mar 17, 2021
@marlonrichert marlonrichert removed the help wanted Extra attention is needed label Apr 18, 2021
@marlonrichert marlonrichert removed the good first issue Good for newcomers label May 7, 2021
@marlonrichert marlonrichert self-assigned this May 7, 2021
marlonrichert added a commit that referenced this issue May 7, 2021
@marlonrichert
Copy link
Owner

All right, it's there.

@marlonrichert
Copy link
Owner

@GabrielDeml Sorry, this turned out not to be a "good first issue" at all. My bad. 😅

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants