Kaynağa Gözat

zsh: ctrl+g fzf with --preview

raylu 2 yıl önce
ebeveyn
işleme
6d87c36f5e
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      zshrc

+ 3 - 2
zshrc

@@ -133,8 +133,9 @@ if [ -x /usr/bin/fzf ]; then
 
 	__fzf_git_commit_sha() {
 		setopt localoptions pipefail no_aliases 2> /dev/null
-		git log --graph --color=always -n 50 --format='%C(auto)%h%d %s %C(black)%C(bold)%cr' |
-			FZF_DEFAULT_OPTS="--ansi --no-sort --tiebreak=index --height ${FZF_TMUX_HEIGHT:-40%} --reverse ${FZF_DEFAULT_OPTS-}" $(__fzfcmd) -m "$@" |
+		git log --color=always -n 50 --format='%C(auto)%h%d %s %C(black)%C(bold)%cr' |
+			FZF_DEFAULT_OPTS="--ansi --no-sort --tiebreak=index --reverse \
+				--preview 'git show --color=always {1}' ${FZF_DEFAULT_OPTS-}" $(__fzfcmd) -m "$@" |
 			sed -r -e 's/([0-9a-f]+) .+/\1/' -e 's/.+ ([0-9a-f]+)/\1/'
 	}
 	fzf-git-commit-sha-widget() {