From fec954c30c9cab73c5b921e77b3c800a804e8422 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sun, 24 Aug 2025 01:48:10 +0200 Subject: [PATCH] zsh:glog: Move header into variable --- .config/zsh/autoload/git/glog | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/zsh/autoload/git/glog b/.config/zsh/autoload/git/glog index 2620bf8..e12bfff 100755 --- a/.config/zsh/autoload/git/glog +++ b/.config/zsh/autoload/git/glog @@ -132,13 +132,21 @@ local -A binds=( # fzf_preview[stat] in this case). It does not really make sense to pass # it to `git log` but can be an indicator for the preview function +local color_brown=$'\e[38;5;144m' +local color_grey=$'\e[38;5;59m' +local header="" +header+="${color_brown}Enter${color_grey}: fullscreen, " +header+="${color_brown}C-y${color_grey}: yank hash, " +header+="${color_brown}C-Space${color_grey}: cycle preview, " +header+="${color_brown}C-[spf]${color_grey}: preview stats/patch/files" + local -a fzf_args=( # Understand ansi color escape sequences. "--ansi" # Expand the binds array in the format "key1:value1,key2:value2". "--bind" "${(@kj:,:)binds/(#m)*/$MATCH:$binds[$MATCH]}" # Display key-bindings in a sticky header - "--header" $'\e[38;5;144mEnter\e[38;5;59m: fullscreen, \e[38;5;144mC-y\e[38;5;59m: yank hash, \e[38;5;144mC-Space\e[38;5;59m: cycle preview, \e[38;5;144mC-[spf]\e[38;5;59m: preview stats/patch/files' + "--header" "$header" # Keep header above prompt line "--header-first" # Execute git show on the commit as preview.