📃 My journey into the plain text life - Intro
Tags: bash, plaintext, geek
Published: 2021-04-23 17:32:56

---
title: 📃 My journey into the plain text life - Intro
published: true
date: 2021-04-23 14:14:00 UTC
tags:
- bash
- plaintext
- geek
canonical_url: https://www.gozgeek.com/posts/2021/my-journey-into-the-plain-text-life-intro/
cover_image: https://cdn.collinsoft.com/file/cdn-collinsoft/gozgeek.com/img/2021/plain-text-journey/plain-text-journey-2048x.jpg
---

_Cover photo by [Bram Naus](https://unsplash.com/@bramnaus) on [Unsplash](https://unsplash.com/s/photos/laptop)_

 **This is an ongoing series:**

- [📃 My journey into the plain text life - Intro](https://dev.to/mrrcollins/tools-for-working-with-plain-text-files-my-plain-text-journey-part-ii-4803)
- [🛠️ Tools for working with plain text files - My Plain Text Journey Part II](https://dev.to/mrrcollins/my-journey-into-the-plain-text-life-intro-3082)
- [🗃️ Syncing my notes - My Plain Text Journey Part III](https://dev.to/mrrcollins/syncing-my-notes-my-plain-text-journey-part-iii-2kf)
- [📝 Journaling - My Plain Text Journey Part IV](https://dev.to/mrrcollins/journaling-my-plain-text-journey-part-iv-5b9)
- [✍ Keeping Notes My Plain Text Journey Part V](https://dev.to/mrrcollins/keeping-notes-my-plain-text-journey-part-v-1pec)
- [✔ Tasks and To Dos My Plain Text Journey Part VI](https://dev.to/mrrcollins/tasks-and-to-dos-my-plain-text-journey-part-vi-50bg)

* * *

I’ve been using plain text for my notes since 2014, and for a journal since 2017. In that time I’ve experimented with the different ways I could use plain text to not only automate my life, but to also help me stay productive. And by productive I mean working on my productivity system instead of doing actual tasks. Be warned, once you start tweaking it’s really easy to procrastinate by “working on your system”.

Please keep in mind, much like Frodo, this was my journey. And much like _The Lord of the Rings Trilogy_, it took me years to get to this spot. Your adventure with plain text will be different. Play around, try different things. As long as you got backups, what do you have to worry about?

## Why plain text?

Plain text is simply a text file. Nothing more, nothing less. It’s about as sexy as going clothes shopping with your mother. You can edit a plain text file on just about any device you have. I have written some of my notes using my Atari 800 as the ultimate no-distraction writing device. Text files have been with us since the dawn of time, and will outlive any other format.

I keep my notes and a journal using [Markdown](https://daringfireball.net/projects/markdown/) for formatting. My tasks or to dos are also in plain text files using the [Taskpaper](https://guide.taskpaper.com/using-taskpaper/) format. I’m currently investigating the [todo.txt](http://todotxt.org/) format because I like the idea of having all the information for a task in the same line.

By using Markdown I can export my notes in a wide variety of formats, such as html or pdf. Just because I can doesn’t mean I do. It’s rare that I would need a paper copy.

## Getting started

You know how you get started? You create a folder on your desktop called **notes** and start saving your notes into the folder. No fuss, no muss. To create or edit your notes, you can use any editor that can save as plain text. VS Code has many fans, along with Sublime Text, but I recommend the best editor ever, Vim.

Once you get more than a handful of notes you’re going to want to have some sort of organizational structure. Or not, I’m sure someone out there worships chaos theory when it comes to file organizing.

Here is how I have it set up:

```
.
├── Archive -> I create a folder for each year
│ ├── 2014 When I no longer need a note
│ ├── 2015 or file, I put it in the
│ ├── 2016 archive for that year
│ ├── 2017
│ ├── 2018
│ ├── 2019
│ ├── 2020
│ └── 2021
├── BlogPosts -> My drafts of BlogPosts
├── Book Ideas -> Working on book ideas. 
├── Books -> Reviews of books of read and notes
├── Journal -> Each year gets a journal - 2021.md
├── Lists -> My to do lists in .taskpaper format
├── Notes -> All of the notes I write.
├── Projects -> When I need to organize notes by project
├── Research -> Folders of data that I am using for research

```

## How I create and name my files

I originally started out naming my files with YYMMDD-_.markdown, but after [reading a blogpost by Tyler Hall](https://tyler.io/dot-dee-tee/), I switched the naming to YYYY-MM-DD-_.md. It does look better. I also add some YAML front matter to each note:

```
---
Title: My Great Post
Author: gozar
date: 2021-04-23T12:14:00-04:00
Slug: my-great-post
Category: 
Tags:
...

```

To automate this, I have the following script:

```
#!/bin/bash

## New Drafts

if [$# -eq 0]; then
    echo "NewNote v.02"
    echo "Enter the name of the note as the argument"
    exit
fi

TITLE="$@"
AUTHOR="`whoami`"
DATE=`date +"%Y-%m-%d %H:%M"`
EDITOR="vim + +startinsert"
DEFAULTFOLDER="."
EXT="md"
#PREPEND="`date +%Y-%m-%d`-"
PREPEND=""
SLUG=$(echo -n "${TITLE}" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z)
if [["${TITLE:0:1}" == "2"]]; then TITLE=${TITLE:11}; fi

if [[! -f ${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}]]; then
    echo -e "---\nTitle: ${TITLE}\nAuthor: ${AUTHOR}\nDate: ${DATE}\nSlug: ${SLUG}\nCategory: \nTags:\nStatus: draft\n...\n\n" > "${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}"
fi

${EDITOR} "${DEFAULTFOLDER}/${PREPEND}${SLUG}.${EXT}"

```

Under Windows I run this in Windows Subsystem for Linux, and under macOS or Linux, you can use it in a terminal window.

I named it `nn`, and to create a new note I navigate to the destination folder and enter the following when I want to add the date to the front:

```
nn 2021-04-23 This is my note

```

But sometimes I don’t want the date, so I’ll just use:

```
nn This is my note

```

If the note doesn’t exists, it creates a note, otherwise, the note is opened in my preferred editor. The script creates a slug for the note and also names the note with the slug. My two examples above would result in the files `2021-04-23-this-is-my-note.md` and `this-is-my-note.md` being created.

## Stay tuned

[Part II is now online](https://dev.to/mrrcollins/tools-for-working-with-plain-text-files-my-plain-text-journey-part-ii-4803)
This is just the beginning of my plain text journey, more is to come!! I still need to share the tools I use, such as [Git](https://git-scm.com/) for syncing and [espanso](https://espanso.org/) for text expansion. There are a few more scripts I use too because I force Bash into everything.