From df820811a6736b6ae11ebaf95b2e7eb95af72cf1 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Thu, 7 May 2026 14:17:54 +0200 Subject: [PATCH] zsh: interactive git log with fzf --- files/shell/.shellrc.alias | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/files/shell/.shellrc.alias b/files/shell/.shellrc.alias index 17d4e44..8148982 100644 --- a/files/shell/.shellrc.alias +++ b/files/shell/.shellrc.alias @@ -15,6 +15,16 @@ alias rm='rm -i' ### fzf alias c='cd $(fd --type d | fzf --reverse)' alias blame='git show $(git ls-files | fzf -e --reverse --bind "enter:become(git blame {1} | fzf -e --ansi --reverse | cut -f 1 -d \" \")")' +unalias glg 2> /dev/null +glg() { + g lg --color | \ + fzf --reverse --ansi \ + --preview 'git show --color=always $(echo {} | grep -o "[a-f0-9]\{7,\}" | head -1)' \ + --preview-window=right:60% \ + --bind 'enter:execute(git show --color=always $(echo {} | grep -o "[a-f0-9]\{7,\}" | head -1) | less -R)' \ + --bind 'ctrl-d:preview-page-down' \ + --bind 'ctrl-u:preview-page-up' +} # nix alias nd="nix develop ."