From 065fab3034ef83e0eee7ccafb5e9b34fbac12648 Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Tue, 21 Jul 2020 10:55:47 -0400 Subject: [PATCH] markdown journal --- zsh/functions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zsh/functions b/zsh/functions index cae253f..932fe90 100644 --- a/zsh/functions +++ b/zsh/functions @@ -129,3 +129,17 @@ cloud() { update-ssh-config --host $search --hostname $ip ssh $search } + +journal() { + today=$(date -j +"%Y-%m-%d_%a") + today_journal=$HOME/Documents/notes/journal/$today.md + if [[ -f $today_journal ]] + then + echo "already exists" + else + echo "not here!" + yesterday=$(date -jv "-1d" +"%Y-%m-%d_%a") + tomorrow=$(date -jv "+1d" +"%Y-%m-%d_%a") + printf "[[$yesterday|Yesterday]] - [[calendar|Index]] - [[$tomorrow|Tomorrow]]\n\n---\n\n" > $today_journal + fi +}