1
0
raylu 1 жил өмнө
parent
commit
10d673031d
1 өөрчлөгдсөн 7 нэмэгдсэн , 18 устгасан
  1. 7 18
      zshrc

+ 7 - 18
zshrc

@@ -79,7 +79,6 @@ alias du='du --max-depth=1'
 alias fd='fdfind'
 alias sr='screen -r'
 alias gip='git pull --ff-only'
-alias gil='git log --graph --abbrev-commit --stat --summary -C --decorate --date=local'
 alias gib='git branch'
 alias gis='git status'
 alias gid='git diff -C --date=local'
@@ -152,6 +151,13 @@ else
 	PROMPT+=$'%{$reset_color%} \n%(!.#.\$) '
 fi
 
+if builtin which gil > /dev/null; then
+	alias giw='gil --show'
+else
+	alias gil='git log --graph --abbrev-commit --stat --summary -C --decorate --date=local'
+	alias giw='git show -C --date=local --decorate'
+fi
+
 if [ -x /usr/bin/fzf ]; then
 	FZF_DEFAULT_OPTS='--no-mouse'
 	source "/usr/share/doc/fzf/examples/key-bindings.zsh"
@@ -207,23 +213,6 @@ 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