mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 23:55:37 +00:00
alter notes for journal folder
This commit is contained in:
parent
615a792005
commit
1eee1ea40a
@ -8,37 +8,36 @@ function notes --description "Notes functions"
|
|||||||
set -g TODAY_NOTE (date +"%Y-%m-%d_%a")
|
set -g TODAY_NOTE (date +"%Y-%m-%d_%a")
|
||||||
set -g YESTERDAY_NOTE (date -jv "-1d" +"%Y-%m-%d_%a")
|
set -g YESTERDAY_NOTE (date -jv "-1d" +"%Y-%m-%d_%a")
|
||||||
set -g TOMORROW_NOTE (date -jv "+1d" +"%Y-%m-%d_%a")
|
set -g TOMORROW_NOTE (date -jv "+1d" +"%Y-%m-%d_%a")
|
||||||
|
set -g LONG_DATE (date +"%A, %B %e, %Y" | sed 's/ */ /g')
|
||||||
|
set -g TODAY_NOTE_FILE $NOTES_PATH/journal/$TODAY_NOTE.md
|
||||||
end
|
end
|
||||||
|
|
||||||
function note_header
|
function note_header
|
||||||
set -g CURRENT_WEATHER (curl -s "https://wttr.in/?format=1")
|
set -g CURRENT_WEATHER (curl -s "https://wttr.in/?format=1")
|
||||||
set -g JOURNAL_HEADER "[[$YESTERDAY_NOTE]] | [[home]] | [[$TOMORROW_NOTE]]\n\n---\n\n$CURRENT_WEATHER\n\n# Today's Goals\n\n\n# Journal\n\n"
|
set -g JOURNAL_HEADER "[Yesterday]($YESTERDAY_NOTE.md) | [Home](home.md) | [Tomorrow]($TOMORROW_NOTE.md)\n\n$LONG_DATE\n$CURRENT_WEATHER\n#journal\n\n---\n\n# Today's Goals\n\n\n# Journal\n\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
function journal --description "Create today's journal"
|
function journal --description "Create today's journal"
|
||||||
note_dates
|
note_dates
|
||||||
if [ -f $NOTES_PATH/$TODAY_NOTE.md ]
|
if [ -f $TODAY_NOTE_FILE ]
|
||||||
echo "Already exists."
|
echo "Already exists."
|
||||||
else
|
else
|
||||||
note_header
|
note_header
|
||||||
printf $JOURNAL_HEADER > $NOTES_PATH/$TODAY_NOTE.md
|
printf $JOURNAL_HEADER > $TODAY_NOTE_FILE
|
||||||
echo "New journal added."
|
echo "New journal added."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function today --description "Open today's journal"
|
function today --description "Open today's journal"
|
||||||
set current_dir $PWD
|
|
||||||
cd $NOTES_PATH
|
|
||||||
note_dates
|
note_dates
|
||||||
if [ -f $TODAY_NOTE.md ]
|
if [ -f $TODAY_NOTE_FILE ]
|
||||||
vim $TODAY_NOTE.md
|
vim $TODAY_NOTE_FILE
|
||||||
else
|
else
|
||||||
note_header
|
note_header
|
||||||
printf $JOURNAL_HEADER > $TODAY_NOTE.md
|
printf $JOURNAL_HEADER > $TODAY_NOTE_FILE
|
||||||
echo "New journal added."
|
echo "New journal added."
|
||||||
vim $TODAY_NOTE.md
|
vim $TODAY_NOTE_FILE
|
||||||
end
|
end
|
||||||
cd $current_dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function meeting --description "Describe a meeting" -a "name"
|
function meeting --description "Describe a meeting" -a "name"
|
||||||
@ -47,30 +46,27 @@ function notes --description "Notes functions"
|
|||||||
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
|
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
|
||||||
set meeting_name (echo $name | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
|
set meeting_name (echo $name | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
|
||||||
set meeting_note $today_date-$meeting_name
|
set meeting_note $today_date-$meeting_name
|
||||||
printf "[[$TODAY_NOTE]] | #meeting\n\n# $name\n\n---\n\n" > $NOTES_PATH/$meeting_note.md
|
printf "[$TODAY_NOTE](journal/$TODAY_NOTE.md) | #meeting\n\n# $name\n\n---\n\n" > $NOTES_PATH/$meeting_note.md
|
||||||
printf "\n\n---\n\n$time - [[$meeting_note]]\n\n---\n\n" >> $NOTES_PATH/$TODAY_NOTE.md
|
printf "\n\n---\n\n$time - [$name](../$meeting_note)\n\n---\n\n" >> $TODAY_NOTE_FILE
|
||||||
open "obsidian://open?vault=notes&file=$meeting_note"
|
open "obsidian://open?vault=notes&file=$meeting_note"
|
||||||
end
|
end
|
||||||
|
|
||||||
function note --description "Edit or create a note" -a "filename"
|
function note --description "Edit or create a note" -a "filename"
|
||||||
set current_dir $PWD
|
|
||||||
cd $NOTES_PATH
|
|
||||||
if test -n "$filename"
|
if test -n "$filename"
|
||||||
vim $filename.md
|
vim $NOTES_PATH/$filename.md
|
||||||
else
|
else
|
||||||
set file (ls | fzf)
|
set file (ls $NOTES_PATH | fzf)
|
||||||
if [ $status -eq 0 ]
|
if [ $status -eq 0 ]
|
||||||
vim $file
|
vim $NOTES_PATH/$file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
cd $current_dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
abbr -a qn 'quicknote'
|
abbr -a qn 'quicknote'
|
||||||
function quicknote --description "Write a quick note" -a "note"
|
function quicknote --description "Write a quick note" -a "note"
|
||||||
note_dates
|
note_dates
|
||||||
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
|
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
|
||||||
printf "\n\n---\n\n#### [[$TODAY_NOTE]] at $time\n$note\n" >> $NOTES_PATH/quick-notes.md
|
printf "\n\n---\n\n#### $time\n$note\n" >> $TODAY_NOTE_FILE
|
||||||
end
|
end
|
||||||
|
|
||||||
abbr -a sn 'syncnotes'
|
abbr -a sn 'syncnotes'
|
||||||
|
Loading…
Reference in New Issue
Block a user