Replies: 1 comment
-
fzf-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
selected=( $(atuin history list --cmd-only | tac | awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' | bat --color=always --wrap never --language=sh --style=plain |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
local ret=$?
if [ -n "$selected" ]; then
num=$selected[1]
if [ -n "$num" ]; then
zle vi-fetch-history -n $num
fi
fi
+ zle -U "$selected"
+ zle kill-buffer
zle reset-prompt
return $ret
}
zle -N fzf-history-widget
bindkey '^R' fzf-history-widget This fixed my issue by adding
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lime-desu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've replaced the original fzf-history widget to use atuin instead, from
fc -rl 1
command toatuin history list --cmd-only | tac
Here's what the snippets looks like
Now upon modifying , I'm experiencing a minor issue the same issue as stated on #2924
Ctrl-R
will show the history widget.Enter
will do nothing (the selected history doesn't get accepted)Beta Was this translation helpful? Give feedback.
All reactions