Arjun's Blog

Using a Work Journal

April 24, 2020

Since early last year, I’ve started maintaining a work journal, a simple markdown file to keep track of my work throughout the day. It helps when I write out my thoughts, to decide if they actually make sense, and flesh out ideas.

I’ve created a simple bash script to reduce the effort it takes to create a new log entry and make it as easy as entering a word.

It automatically creates a file for that day, if it is not yet created, or gets that day’s file if it exists, and then opens up Vim editor with the current timestamp and in insert mode!

If you think it might he helpful to you, check it out:

filename=$(date +%Y-%m-%d)".md"
title=$(date +%A,\ %b\ %d\ %Y)
cd $homedir
if [ -e $filename ]; then
  echo "# "$title > $filename
if [ $file_exists ]; then
echo $newline_gap"## "$(date +%r)"\n- " >> $filename
vim '+ normal GA' -c 'startinsert' $filename
printf "\033c"
fortune | pokemonsay

Don’t forget to add an alias:

$ worklog='sh ~/worklog/create-log.sh'

It is then as simple as typing worklog:

$ worklog

You will then see Vim editor opened up, nicely formatted, and in insert mode: screenshot

Tagged under: programminghowtoproductivity
Arjun Munji

Personal blog by  Arjun Munji.
I like to learn things.