Last active
October 10, 2023 14:26
-
-
Save timmyha/717a24f8a3157b21efcf9e842381510c to your computer and use it in GitHub Desktop.
fish shell 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