loading...

A Tool to Write Simple Notes

miku86 profile image miku86 ・1 min read

Shorties (8 Part Series)

1) Git: Show staged changes 2) Bash: Rename specific files in a folder 3 ... 6 3) VSCode: Transform text to lowercase/uppercase/titlecase 4) Git: How to move misallocated commits 5) Git: Find specific, deleted content in a file 6) Git: Delete merged branches 7) A Tool to Write Simple Notes 8) Find all files with a specific name and show their file size

Problem

I read/listen/watch stuff and want to write down notes.

I have to:

  • create a new file or open an old one
  • start my editor
  • wait for my editor to load
  • manage all files, because I have a lot of them

This is annoying.


Solution (Linux)

I need a simple tool to write down notes quickly.

Without the hassle of thinking about a new file, a name for it, the place where to store it, the editor loading times etc.

  1. Open my hidden shell configuration file. I use Zsh, so I use ~/.zshrc. If you use Bash, you can use ~/.bashrc.

  2. Add alias n='function _note(){echo "$(date +%Y-%m-%d_%H:%M: )" "$1" >> notes.txt;}; _note'

  3. Type the note in the shell: n "my very important note"

  4. See the result

simple notes


Explanation

alias n: the command I want to use, in this case n. You can use whatever you want as a command, e.g. alias note.

'function _note(){...}; _note': setup a function named _note and run it.

echo "$(date +%Y-%m-%d_%H:%M: )" "$1" >> notes.txt;: take the current date in my desired format, add the first input after the alias and append it to the file notes.txt

"$(date +%Y-%m-%d_%H:%M: )": the current date in my desired format
"$1": the first input after the alias (e.g. my very important note)
>>: append
notes.txt: where I want to save my note


Further Reading

Shorties (8 Part Series)

1) Git: Show staged changes 2) Bash: Rename specific files in a folder 3 ... 6 3) VSCode: Transform text to lowercase/uppercase/titlecase 4) Git: How to move misallocated commits 5) Git: Find specific, deleted content in a file 6) Git: Delete merged branches 7) A Tool to Write Simple Notes 8) Find all files with a specific name and show their file size

Posted on by:

miku86 profile

miku86

@miku86

Mentor & Educator & Senior Web Developer - I help people to reach their (career) goals. => https://miku86.com/mentoring

Discussion

markdown guide
 

Thats pretty neat. I tried in the past todotxt.org and it was cool too. In the end I just wasn't that much into doing it via the terminal (though I spend quite a bit of time on it)
Im now working in a small side project to create a very basic Digital Bullet Journal (dibujo.now.sh) and Im writing about it here too.

Off-topic question: how do you create the post index at the top of your post?

 

Hey Nico,

thanks for your comment, todotxt.org looks quite handy.
Your Bullet Journal looks pretty useful, great work! I try to stay focused by minimizing my open browser tabs, therefore I've built it in the terminal.

If you want to create a post index,
you have to add a series property into your post header:

Example:

---
title: "A Tool to Write Simple Notes"
[other properties]
series: Shorties
---

In the first post of your series the index won't show up, only if you'd add a second post.