Open jezus-nunez opened 3 years ago
I found a workaround, you can do this and create a widget that will call both per-directory-history-toggle-history
and fzf-history-widget
. It also helps that powerlevel10k
has a feature that shows whether or not per-directory-history-toggle-history
is active. Here is what I put in my .zshrc
.
per-dir-fzf() {
# if history file in use is not the directories (i.e., is global)
if [[ $_per_directory_history_is_global == true ]]; then
per-directory-history-toggle-history; fzf-history-widget
else
fzf-history-widget
fi
}
zle -N per-dir-fzf
bindkey '®' per-dir-fzf # alt+t instead of ctrl+t (normal fzf widget)
Hope this helps somewhat.
Edit: I just realized that I added the functionality to p10k
and it doesn't come by default. However, it is easy to add.
Create a function titled prompt_my_per_dir_status
if $_per_directory_history_is_global; then
return
else
p10k segment -i ''
fi
Then in your .p10k.zsh
file add the following to this array:
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
my_per_dir_status
)
Tried a variant from which includes the binding for ^G https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh
But it is failing silently, when calling it straight from the terminal I get
Any hints on how to make this work, bypassing the ZLE requirement?