From 4d9462239ff5eab6eb62a21393466aac98e07994 Mon Sep 17 00:00:00 2001 From: bretello Date: Wed, 25 Oct 2023 11:43:16 +0200 Subject: [PATCH] zsh: move git fuzzy log to gitconfig (usage: `git flog`) --- functions/git.zsh | 6 ------ gitconfig | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/functions/git.zsh b/functions/git.zsh index 65583a5..be7e444 100644 --- a/functions/git.zsh +++ b/functions/git.zsh @@ -37,12 +37,6 @@ function git-switch-recent-branch(){ # compdef git-sort-branch-by-usage git-switch-recent-branch compdef "__git_completion_wrapper __git_recent_branches" git-switch-recent-branch -# Runs git log with fzf with preview -function fgitlog() { - git showtool $(git log --oneline $@ | fzf --multi --preview 'git -p show --color=always {+1}' --preview-window=right,60% | awk '{print $1}') -} -compdef _git fgitlog=git-log - function git-commit-show() { git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" $@ | fzf --ansi --no-sort --reverse --tiebreak=index --preview \ diff --git a/gitconfig b/gitconfig index cea6e58..2f0cfda 100644 --- a/gitconfig +++ b/gitconfig @@ -35,3 +35,4 @@ abbrevcommit = true [alias] showtool = "!showci () { rev=${1:-HEAD}; git difftool $rev~1 $rev; }; showci $1" mylog = "log --pretty='format:👉 %C(yellow)commit: %h%C(auto)%d %Creset%nAuthor: %C(auto,cyan)%>(12)%an (%aE)%n%C(reset)Date: %C(auto,green)%ar%Creset%nContent: %s'" +flog = "!flog() { git log --oneline $@ | fzf --multi --preview 'git -p show --color=always {+1}' --preview-window=right,60% | awk '{print $1}'; }; flog"