From 3c50b3276df8adb736b694268730967d86b46b6e Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Mon, 10 Jun 2019 15:34:32 +0200 Subject: [PATCH] Add note tool --- shell/notes | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 shell/notes diff --git a/shell/notes b/shell/notes new file mode 100755 index 0000000..3fbf1b1 --- /dev/null +++ b/shell/notes @@ -0,0 +1,18 @@ +function note() { + ( + local title="$1" + local timestamp="$(date +%Y-%m-%dT%H:%M:%S%z)" + local dir="${HOME}/Dropbox/Notes" + + mkdir -p "${dir}" + cd "${dir}" + if [[ -n $1 ]]; then + exec vim "$timestamp-$title.md" + else + exec vim . + fi + ) +} + +# vim: ft=zsh +