dotfiles/shell/notes

18 lines
348 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function note() {
(
local title="$1"
local timestamp="$(date +%Y-%m-%dT%H%M%S%z)"
local dir="${HOME}/.local/var/lib/notes"
mkdir -p "${dir}"
cd "${dir}"
if [[ -n $1 ]]; then
exec vim "$timestamp-$title.md"
else
exec vim .
fi
)
}
# vim: ft=zsh