Skip to content

Instantly share code, notes, and snippets.

@george124816
Created May 21, 2024 14:04
Show Gist options
  • Save george124816/53300004b48904aa2e3bb9c00ab215eb to your computer and use it in GitHub Desktop.
Save george124816/53300004b48904aa2e3bb9c00ab215eb to your computer and use it in GitHub Desktop.
note system
#!/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