I use a similar function in my bashrc. I keep notes on a daily basis with :
function note {
if [[ -z $1 ]]; then
vim ~/my_notes/$(date '+%F').md;
else
echo -e $@ >> ~/my_notes/$(date '+%F').md;
fi
}