Obsidian 1.6 Desktop (Public)
obsidian.md
obsidian.md
I have a script that runs on login that simply opens two files:
1: this calendar week
2: the last calendar week
... in vim tabs, organized in yearly directories. I live in the terminal anyway.Making myself see the thing, by opening automatically, was the big part. That let me write more. Keeping the storage simple makes the data accessible and portable.
All of this applies to Obsidian and things too - but I enjoy this kind of tinkering
NOTE_DIR="${NOTE_DIR:-${HOME}/notes}"
CURRENT_NOTE=$(date +%Y-week%V)
LAST_WEEK_NAME=$(date -d '7 days ago' +%Y-week%V)
NOTE_PATHS=("$NOTE_DIR/$CURRENT_NOTE" "$NOTE_DIR/$LAST_WEEK_NAME")
EDITOR="${EDITOR:-vim}"
if [[ $EDITOR == *vim* ]]; then
# Run the vim-like editor with tabs
$EDITOR -c ':tab all' "${NOTE_PATHS[@]}"
else
# Run the editor without vim tab arg
$EDITOR "${NOTE_PATHS[@]}"
fi
The bit for '$EDITOR' makes this work for 'vim', but also 'gvim' (vim-X11) and 'neovim'.The assumption for 'else' is that the other editors simply accept an array of arguments with no other direction required
Edit: I realize now I misspoke - no yearly directories [anymore]; dashed names instead! Apparently I quit that in week 10 of 2023.
IIRC, managing the directories added a few lines I didn't care to keep. I don't look outside of the two week window often :)