Skip to content

Instantly share code, notes, and snippets.

@timmyha
Last active October 10, 2023 14:26
Show Gist options
  • Select an option

  • Save timmyha/717a24f8a3157b21efcf9e842381510c to your computer and use it in GitHub Desktop.

Select an option

Save timmyha/717a24f8a3157b21efcf9e842381510c to your computer and use it in GitHub Desktop.
fish shell notes function
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