From 7b8b96ac03cfdf2e278740025ac0655e1034175c Mon Sep 17 00:00:00 2001 From: samedami Date: Sat, 16 May 2020 20:46:04 +0200 Subject: [PATCH] Add 'fgdiff' and 'fglog' scripts --- .local/bin/scripts/fgdiff | 6 ++++++ .local/bin/scripts/fglog | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100755 .local/bin/scripts/fgdiff create mode 100755 .local/bin/scripts/fglog diff --git a/.local/bin/scripts/fgdiff b/.local/bin/scripts/fgdiff new file mode 100755 index 0000000..f0f6e2c --- /dev/null +++ b/.local/bin/scripts/fgdiff @@ -0,0 +1,6 @@ +#!/bin/sh + +# Fuzzy Git uncommited files changes browser. + +git status | awk '/modified/ { print $2 }' | fzf --preview \ + 'git diff --color=always {}' diff --git a/.local/bin/scripts/fglog b/.local/bin/scripts/fglog new file mode 100755 index 0000000..f5e2138 --- /dev/null +++ b/.local/bin/scripts/fglog @@ -0,0 +1,7 @@ +#!/bin/sh + +# Fuzzy Git commits browser. + +git log --no-decorate --format=short | awk '/^commit|^ /' | + sed 's/ //g; s/commit //g' | paste -d " " - - | fzf --preview \ + 'git log -n 1 {1}; printf "\n" && git diff --color=always {1}~ {1}'