Created
December 18, 2023 07:11
-
-
Save timmyha/e549bf5a6fe023888e010e06aa7798a7 to your computer and use it in GitHub Desktop.
fish notes function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function noted -a 'filename' | |
| cd ~/Documents/notes | |
| if test -n "$filename" | |
| if test -e "$argv.md" | |
| echo "opening daily note" | |
| nvim "$argv.md" | |
| else | |
| echo "creating new daily note, opening" | |
| touch "$argv.md" | |
| nvim "$argv.md" | |
| end | |
| else if test -e "$(date +%F).md" | |
| echo "opening daily note" | |
| nvim "$(date +%F).md" | |
| else | |
| echo "creating new daily note, opening" | |
| cp ~/Documents/notes/templates/daily_note.md "$(date +%F).md" | |
| nvim "$(date +%F).md" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment