diff --git a/.chezmoiscripts/run_once_after_30_install_hunk.sh b/.chezmoiscripts/run_once_after_30_install_hunk.sh new file mode 100644 index 0000000..77c0c09 --- /dev/null +++ b/.chezmoiscripts/run_once_after_30_install_hunk.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -eufo pipefail + +if [ "${CHEZMOI_SKIP_HUNK_INSTALL:-0}" = "1" ]; then + exit 0 +fi + +# Volta is user-installed (see dot_zshenv); skip cleanly when absent so a +# fresh host that hasn't bootstrapped Volta yet doesn't fail apply. +if [ ! -x "$HOME/.volta/bin/volta" ]; then + echo "⏭ Skipping hunk install: Volta not found at \$HOME/.volta" + exit 0 +fi + +export VOLTA_HOME="$HOME/.volta" +export PATH="$VOLTA_HOME/bin:$PATH" + +if command -v hunk &>/dev/null; then + exit 0 +fi + +echo "📦 Installing hunkdiff via Volta" +volta install hunkdiff diff --git a/dot_config/git/config.tmpl b/dot_config/git/config.tmpl index efaa08b..405320c 100644 --- a/dot_config/git/config.tmpl +++ b/dot_config/git/config.tmpl @@ -40,6 +40,11 @@ ds = diff --staged dt = difftool dump = cat-file -p + + # hunk — terminal diff viewer (opt-in; delta remains the default pager) + hd = !hunk diff + hs = !hunk show + hp = !hunk pager pusho = !git push --set-upstream origin `git cb` root = rev-parse --show-toplevel st = status diff --git a/dot_config/hunk/config.toml b/dot_config/hunk/config.toml new file mode 100644 index 0000000..5820cfb --- /dev/null +++ b/dot_config/hunk/config.toml @@ -0,0 +1,6 @@ +theme = "midnight" +mode = "auto" +line_numbers = true +wrap_lines = false +exclude_untracked = false +agent_notes = true