Is there a way to disable history behavior? #424
-
I am used to using fzf's built-in ctrl+R history search. I noticed that by setting it to load after autocomplete that I can get this keybind to function, however various keystrokes like up arrow will bring up a menu provided by autocomplete that is limited to a fixed number of entries. I understand that this limit is configurable, but the mere fact that this config exists and is defaulted to a value of 16 is a strong hint that setting it to a large value will have a performance impact. I could dive in-depth as to why the behavior present in zsh-autocomplete is inferior to that of fzf but this seems unnecessary. So I would like to disable both types of history related functionality from this plugin entirely and have up arrow function like it does in vanilla zsh, which seems to be that it will just pull up whatever history whose beginning exactly matches what has been typed in (before fzf I used to use That is to say, I'd like to use this autocomplete plugin only for the display of completions and none of its history-related features. Is there a way to achieve this? config doc is not complete enough. I will try to look around in the source and post back if i find suitable configuration that I can set. EDIT! I've realized that the history feature of this plugin has some redeemable capabilities!! One thing that I haven't had a good way to do before is to issue multiple commands from before into a single new command. However the history completion menu in this plugin makes that rather easy to do. The plot thickens! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I have attempted to put this into my zshrc after the plugin is loaded.
This is a small amount of progress. Because after the up arrow is pressed, autocomplete does interfere with the situation in some kind of way that the "beginning-search" gets clobbered such that the buffer being beginning-searched becomes the full buffer at this point, thus preventing beginning-search from behaving as intended. At the end of the day it is not too bad to re-enter fzf as a relief valve... |
Beta Was this translation helpful? Give feedback.
-
The config doc does in fact say how to achieve this: Line 67 in d6a0ff5 Line 73 in d6a0ff5 So, in order to get the default Zsh behavior of the up and down arrows, you need to add this to your bindkey '\e[A' up-line-or-history
bindkey '\eOA' up-line-or-history
bindkey '\e[B' down-line-or-history
bindkey '\eOB' down-line-or-history
Again, that's already possible and documented. For up arrow: Line 25 in d6a0ff5 For Ctrl-R and Ctrl-S: Line 28 in d6a0ff5 |
Beta Was this translation helpful? Give feedback.
The config doc does in fact say how to achieve this:
zsh-autocomplete/.zshrc
Line 67 in d6a0ff5
zsh-autocomplete/.zshrc
Line 73 in d6a0ff5
So, in order to get the default Zsh behavior of the up and down arrows, you need to add this to your
.zshrc
after sourcing Zsh Autocomplete: