From b5a8f615208f8efb982d66b09adcac1535d15ee7 Mon Sep 17 00:00:00 2001 From: mi_sawa Date: Sun, 10 May 2026 22:46:16 +0200 Subject: [PATCH] Update defer template example --- docs/src/Examples.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/src/Examples.md b/docs/src/Examples.md index c87d9c08..2c9f5fef 100644 --- a/docs/src/Examples.md +++ b/docs/src/Examples.md @@ -27,7 +27,12 @@ Then add a template that calls `zsh-defer source` instead of just `source`. ```toml [templates] -defer = "{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}{{ hooks?.post | nl }}" +defer = """ +zsh-defer -c "$(cat <<'SHELDON_DEFER' +{{ hooks?.pre | nl }}{% for file in files %}source "{{ file }}" +{% endfor %}{{ hooks?.post | nl }}SHELDON_DEFER +)" +""" ``` Now any plugin that you want to defer you can apply the `defer` template. For