|
|
@@ -83,7 +83,6 @@ alias gil='git log --graph --abbrev-commit --stat --summary -C --decorate --date
|
|
|
alias gib='git branch'
|
|
|
alias gis='git status'
|
|
|
alias gid='git diff -C --date=local'
|
|
|
-alias giw='git show -C --date=local --decorate'
|
|
|
alias gic='git checkout'
|
|
|
alias giu='git reset HEAD\^'
|
|
|
alias gn='git number'
|
|
|
@@ -208,6 +207,23 @@ if [ -x /usr/bin/fzf ]; then
|
|
|
}
|
|
|
zle -N fzf-rg-widget
|
|
|
bindkey '^S' fzf-rg-widget
|
|
|
+
|
|
|
+ giw() {
|
|
|
+ local commit=${1:-HEAD}
|
|
|
+ git diff-tree --color=always --stat --no-commit-id $commit | sed '$d' | cut -c 2- | \
|
|
|
+ fzf --filepath-word --ansi --layout=reverse --bind enter:abort \
|
|
|
+ --header="$(git show --date=local --decorate --shortstat --color=always $commit)" \
|
|
|
+ --preview-window='right,<110(down,70%)' \
|
|
|
+ --preview="git diff-tree --patch --no-commit-id --color=always $commit {1} | delta" \
|
|
|
+ --bind tab:toggle-preview,ctrl-y:preview-up,ctrl-e:preview-down \
|
|
|
+ --bind ctrl-b:preview-page-up,ctrl-f:preview-page-down \
|
|
|
+ --bind ctrl-u:preview-half-page-up,ctrl-d:preview-half-page-down \
|
|
|
+ --bind="ctrl-o:execute(git diff-tree --patch --no-commit-id --color=always $commit {1} | delta --paging=always)" \
|
|
|
+ --bind="ctrl-s:execute(git show -C --date=local --decorate $commit)"
|
|
|
+
|
|
|
+ }
|
|
|
+else
|
|
|
+ alias giw='git show -C --date=local --decorate'
|
|
|
fi
|
|
|
|
|
|
stty stop undef
|