Skip to content

Instantly share code, notes, and snippets.

@purarue
Last active November 16, 2024 07:04
Show Gist options
  • Save purarue/bf1e82b29e87eb0bb3b88898e735deb5 to your computer and use it in GitHub Desktop.
Save purarue/bf1e82b29e87eb0bb3b88898e735deb5 to your computer and use it in GitHub Desktop.
journal-new() {
local target
cd "${XDG_DOCUMENTS_DIR}/Notes/journal" || return
target="$(date "+%Y-%m-%d").md"
if [[ ! -f "$target" ]]; then
{
date
printf '\n\n'
} >"$target"
fi
nvim "$target"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment