zsh: interactive git log with fzf

This commit is contained in:
2026-05-07 14:17:54 +02:00
parent 3ec45a7082
commit df820811a6
+10
View File
@@ -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 ."