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

Feed all zsh history into fzf (not only most recent) #19

Merged
merged 1 commit into from Feb 25, 2014

Conversation

wellle
Copy link
Contributor

@wellle wellle commented Feb 25, 2014

When I execute history in Zsh I see only the 16 most recent commands. Fuzzy finding on them doesn't make much sense. Adding -$HISTSIZE shows all commands from the history that are saved.

Also adding -n removes the command index, so the sed command can be removed.

@junegunn
Copy link
Owner

Hey, thanks for the patch! I didn't know that history command of zsh truncates the list by default.
But could you restore the numeric index part?
I find it quite useful when the list is filled with many similar items.

@wellle
Copy link
Contributor Author

wellle commented Feb 25, 2014

Done.

junegunn added a commit that referenced this pull request Feb 25, 2014
Feed all zsh history into fzf (not only most recent)
@junegunn junegunn merged commit c1be834 into junegunn:master Feb 25, 2014
@wellle wellle deleted the zsh_history branch February 25, 2014 14:42
@junegunn
Copy link
Owner

Thank you.

@wellle
Copy link
Contributor Author

wellle commented Feb 25, 2014

👍

junegunn added a commit that referenced this pull request Feb 26, 2014
@junegunn
Copy link
Owner

@wellle I've just realized that this change doesn't work on oh-my-zsh,
where history is an alias to fc -l 1.
Although I'm not particularly fond of oh-my-zsh, it has such a large user base,
so I've made a slight adjustment to the command.

@wellle
Copy link
Contributor Author

wellle commented Feb 26, 2014

Oh that's an important point! Looking at it again, instead of 'history' -$HISTSIZE we could also use one of these:

  1. 'history' 1
  2. fc -l 1

Both should work and seem simpler than what we have right now. Let me know if you want me to implement either of these.

@junegunn
Copy link
Owner

Okay, looks good to me. I'm fine with either one. Feel free to open another PR. Thanks.

@blueyed
Copy link
Contributor

blueyed commented Jun 19, 2014

FWIW, you could use 'command history' to skip any aliases.

@junegunn
Copy link
Owner

@blueyed Thanks. There was a recent pull request which applied that method.

junegunn pushed a commit that referenced this pull request Jan 16, 2024
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.

None yet

3 participants