From e196a2a724d64c7803e1d991daf0b921cb2d3a13 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Fri, 23 Apr 2021 22:46:13 +0200 Subject: [PATCH] Binds for previes scroll. --- zsh/fzf.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/fzf.zsh b/zsh/fzf.zsh index fdc4266..9c8bbe3 100644 --- a/zsh/fzf.zsh +++ b/zsh/fzf.zsh @@ -18,7 +18,7 @@ gl() { files=$(sed -nE 's/.* -- (.*)/\1/p' <<< "$*") cmd="echo {} |grep -Eo '[a-f0-9]+' |head -1 |xargs -I% git show --color=always % -- $files | cat" g=(git log --graph --format='%C(auto)%h%d %s %C(black)%C(bold)%cr%Creset' --color=always "$@") - fzf=(fzf --ansi --reverse --tiebreak=index --no-sort --bind='ctrl-j:preview-up' --bind='ctrl-k:preview-down' --bind="ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' |pbcopy)" --bind="enter:execute($cmd | LESS='-r' less)" --preview 'f() { set -- $(echo -- "$@" | grep -o "[a-f0-9]\{7\}"); [ $# -eq 0 ] || git show --color=always $1; }; f {}') + fzf=(fzf --ansi --reverse --tiebreak=index --no-sort --bind='k:preview-up' --bind='j:preview-down' --bind="ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' |pbcopy)" --bind="enter:execute($cmd | LESS='-r' less)" --preview 'f() { set -- $(echo -- "$@" | grep -o "[a-f0-9]\{7\}"); [ $# -eq 0 ] || git show --color=always $1; }; f {}') $g | $fzf return 0 }