feat: enhance chezmoi fzf tools with bat syntax highlighting for diffs/file previews

This commit is contained in:
2025-12-29 18:35:52 -06:00
parent a1cf700160
commit 3ee25fb90c
2 changed files with 2 additions and 2 deletions
@@ -23,7 +23,7 @@ function chai --description "Interactive chezmoi apply with fzf diff preview"
--with-nth=4 \ --with-nth=4 \
--nth=1 \ --nth=1 \
--prompt='Apply Changes > ' \ --prompt='Apply Changes > ' \
--preview='chezmoi diff {1} 2>/dev/null | head -100' \ --preview='chezmoi diff {1} 2>/dev/null | bat -pp --color=always --language=diff' \
--preview-window=right:60%:wrap \ --preview-window=right:60%:wrap \
--multi \ --multi \
--bind='ctrl-a:toggle-all' \ --bind='ctrl-a:toggle-all' \
@@ -14,7 +14,7 @@ function chshow --description "Browse chezmoi managed files with fzf preview"
--with-nth=4 \ --with-nth=4 \
--nth=1,2 \ --nth=1,2 \
--prompt='Chezmoi Files > ' \ --prompt='Chezmoi Files > ' \
--preview='chezmoi cat {1} 2>/dev/null || echo "Preview unavailable"' \ --preview='chezmoi cat {1} 2>/dev/null | bat -pp --color=always --file-name={1} 2>/dev/null || echo "Preview unavailable"' \
--preview-window=right:60%:wrap \ --preview-window=right:60%:wrap \
--expect='ctrl-e' \ --expect='ctrl-e' \
--header='Enter: view | Ctrl+E: edit source') --header='Enter: view | Ctrl+E: edit source')