|
|
|
|
|
by faxmeyourcode
483 days ago
|
|
I've got something very similar as a function in my ~/.zshrc, except instead of days separated by lines I start a new file for each topic. Most of my notes are write-only for a day or so but I keep the old ones around just in case I need to grep through everything (and I've saved myself doing this a few times). function notes {
THIS_MONTH="$(date '+%Y-%m')"
mkdir -p "$NOTES_FOLDER/$THIS_MONTH" # create folder if it doesn't exist.
cd "$NOTES_FOLDER/$THIS_MONTH"
if [ -z "$1" ]; then
return 0
fi
vim $1
cd -
}
Running `notes` will take you to today's directory to poke around, and `notes file.md` will open file.md in the appropriate dir. |
|