DEV Community

Cover image for ๐Ÿ“ Journaling - My Plain Text Journey Part IV
Ryan Collins
Ryan Collins

Posted on • Originally published at gozgeek.com on

๐Ÿ“ Journaling - My Plain Text Journey Part IV

This is an ongoing series:


A journal is a great way to remember things that happen, or to take note of something that may be useful in the future. They also let you reflect, giving you a better understanding of your life and where you are going. There are a number of journaling apps out there, but here is how I do mine with nothing more than a text editor.

My journal

Iโ€™ve tried several different types of journals. Before I settled on the plain text life, my favorite was a password protect blog at wordpress.com. Itโ€™s still up with a bunch of entries, but Iโ€™ve found that plain text journaling works better for me.

To organize my journaling, I create a file for each year in a folder caller Journal. For example, unsurprisingly my current journal is a file named 2021.md. Some like to create a file for each day. I tried that for awhile, but it just didnโ€™t work for me. My editor of choice is Vim, and it handles files with 10s of thousands of lines without issue.

Organizing entries

At midnight, I have a job that runs called nextday.sh. The main location for my notes is on a virtual private server (VPS), which makes it easy to schedule jobs like this.

#!/bin/bash

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"

JDATE=$(date +"%D - %a")

# Sync, just in case
cd ~/notes
./notesync.sh

# Create a new day in the journal
echo -e "\n# ${JDATE}" >> ${JOURNAL}

# Sync, just in case
./notesync.sh

Enter fullscreen mode Exit fullscreen mode

It adds the current date to the journal, along with the day of the week. I originally only put the date, but when looking back it is nice to know what day of the week an event happened. By including the day of the week I donโ€™t have to consult a calendar.

Each entry is prefaced with YYYY/mm/dd HH:MM, which I create with an Espanso expansion, an abbreviation in Vim (iab <expr> dts strftime("%Y/%m/%d %H:%M -") lets me type dts to insert a date time stamp), or an Ultisnip snippet with the Ultisnip plugin for Vim. If you use a different text editor, there is probably a way for you to easily insert the date and time stamp.

Adding entries

I have three ways to add entries.

je function

In my .bashrc I have a function named je:

je() {
    ENTRY=$1
    echo -e "\n`date +\"%Y/%m/%d %R\"` - ${1}" >> ~/notes/Journal/`date +"%Y"`.md
}

Enter fullscreen mode Exit fullscreen mode

If you donโ€™t want to add a function you could create a script and place it in your path. To add an entry I type je "This is my entry".

j alias

For longer or multiple entries I have an alias that launches Vim with my Journal, takes me to the end of the file, and puts me in insert mode:

alias j='vim + +startinsert ~/notes/Journal/`date +"%Y"`.md'

Enter fullscreen mode Exit fullscreen mode

** TelegramBot **

I wish I could share this, but itโ€™s not quite ready yet. The bot, which I call Brantley, has several features. One is the ability to append entries to my Journal. This makes adding entries as simple as sending a text message in Telegram.

The bot runs on the same VPS as the scheduled job to mark a new entry for each day. Iโ€™ll be sharing it soon, so stay tuned!

Additional ramblings

To help with entries, Iโ€™m experimenting with adding questions to be answered throughout the day. Iโ€™m not very consistent on answering the questions, so they usually get deleted, but sometimes I do answer them. These are added to the journal with additional cron jobs.

Morning questions

At 5am, the following questions are added:

YYYY-mm-dd 05:00 - Morning Routine

    My Daily Highlight:

    I am grateful for:
    1.
    2.
    3.

    What would make today great?
    1.
    2.

Enter fullscreen mode Exit fullscreen mode

Under What would make today great I only list things that I can control or do. Itโ€™s never, โ€œI wish Jane would stop coming to my desk for chit-chatโ€. I write something like โ€œIโ€™m going to complete 3 tasks on my big projectโ€.

Here is the script I use to add the questions:

#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"
je=$(date +"%Y/%m/%d %H:%M")
echo "${nl}${je} - Morning Routine" >> ${JOURNAL}
cat <<EOT >> ${JOURNAL}

    My Daily Highlight: 

    I am grateful for:
    1. 
    2. 
    3. 

    What would make today great?
    1. 
    2. 

EOT

Enter fullscreen mode Exit fullscreen mode

Daily Affirmation

At noon the following gets added: I am.... I try to write something positive about myself. Hereโ€™s the script I use to add that to the journal:

#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").markdown"
je="$(date +"%Y/%m/%d %H:%M")"
echo "${nl}${je} - Daily Affirmations" >> ${JOURNAL}
cat <<EOT >> ${JOURNAL} 
    I am...

EOT

Enter fullscreen mode Exit fullscreen mode

Evening routine

At 7pm the following gets added to the journal:

3 Amazing things that happened today
1. 
2. 
3. 

How could I have made today better?

Enter fullscreen mode Exit fullscreen mode

As with the morning questions, I answer these as things that I did or influenced. Trying to control others never works. To add these lines I schedule the following script at 7pm:

#!/bin/bash

nl=$'\n'

#Where is the journal
JOURNAL="/home/goz/notes/Journal/$(date +"%Y").md"
je="$(date +"%Y/%m/%d %H:%M")"
echo "${nl}${je} - Nightly Routine" >> ${JOURNAL}
cat <<EOT >> ${JOURNAL} 
    3 Amazing things that happened today
    1. 
    2. 
    3. 

    How could I have made today better?

EOT

Enter fullscreen mode Exit fullscreen mode

Like I said before, itโ€™s nice to have these questions added, but it seems like I only answer them about half the time.

Go forth and journal

This is how I journal, not how you should journal. It has taken me a few years to get to the point where Iโ€™m comfortable with sharing how I do it. Hopefully there are some nuggets of wisdom that will help you along your journey!

Do you do something differently? Or is there something thatโ€™s unclear? Let me know in the comments!

Top comments (0)