zsh:glog: Move header into variable

This commit is contained in:
2025-08-24 01:48:10 +02:00
parent 372865f9c4
commit fec954c30c

View File

@@ -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.