diff --git a/.config/fish/functions/jrnl.fish b/.config/fish/functions/jrnl.fish index 29417045..af30b164 100644 --- a/.config/fish/functions/jrnl.fish +++ b/.config/fish/functions/jrnl.fish @@ -45,36 +45,38 @@ function jrnl --description 'Lightweight journaling tool' switch $response case y Y begin - echo "# $(date +'%A, %b %d, %Y')"\n + echo '# %{date}'\n + echo '' + echo '' - echo "## Gratitude"\n + # echo "## Gratitude"\n - echo "I'm grateful for ..."\n + # echo "I'm grateful for ..."\n - echo "## + Wins"\n + # echo "## + Wins"\n - echo "- small_victories"\n + # echo "- small_victories"\n - echo "## - Challenges"\n + # echo "## - Challenges"\n - echo "- hard_things"\n + # echo "- hard_things"\n - echo "## Reflection"\n + # echo "## Reflection"\n - echo "_One sentence to reflect on today:_"\n + # echo "_One sentence to reflect on today:_"\n - echo "- reflection"\n + # echo "- reflection"\n - echo "## Learned"\n + # echo "## Learned"\n - echo "- fact_insight_or_skill"\n + # echo "- fact_insight_or_skill"\n - echo "## Tomorrow"\n + # echo "## Tomorrow"\n - echo "- prep"\n + # echo "- prep"\n end >$template eval $EDITOR $template - set -f new_template + break case n N break end @@ -87,6 +89,7 @@ function jrnl --description 'Lightweight journaling tool' set entry "$jdir/$today.md" # check if journal entry exists if not test -f $entry + set contents (string join \n "# $today" "$(tail -n +2 $template)" | string collect -N) cat $template >$entry set -l prompt "Created $entry, open in $EDITOR? (y/n)" while read --nchars 1 -l response --prompt-str="$prompt" or return 1