Created
May 21, 2024 14:04
-
-
Save george124816/53300004b48904aa2e3bb9c00ab215eb to your computer and use it in GitHub Desktop.
note system
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
#!/bin/bash | |
year=$(date +%Y) | |
month=$(date +%m) | |
day=$(date +%d) | |
template="$year-$month-$day\n\nTODO:" | |
dir=$HOME/notes | |
folder_path=$dir/$year/$month | |
file_path=$folder_path/$day.md | |
mkdir -p $folder_path | |
if [ -f $file_path ]; then | |
nvim $file_path | |
else | |
printf $template > $file_path | |
nvim $file_path | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment