notes2.sh/README.md

1.7 KiB

Plain-text note taking system

This is a script that helps you with taking notes and looking them up later. It uses a simple system of putting notes in individual directories under ~/Notes. The directory names look like 20241116091658-some_note, and each contains at least one note.md file.

The script doesn't have any user interface itself, but relies on a combination of fzf and your default $EDITOR.

The previous iteration of this tool used to store notes in MIME envelopes, but that created problems with opening the same note simultaneously from multiple places. So this version uses plain directories.

Features

  • No need to manually assign directory names (they are chosen for you and contain the note title)
  • Creating a new note is instant
  • Search by title is very fast / optimized. Even if you have thousands of notes
  • All notes have a unique ID which you can use to link between notes
  • The code is written in bash with standard Unix tools, and is easy to read

Getting started

  • Put notes.sh file from this repo somewhere to your $PATH
  • Install fzf

Then add the following aliases to your ~/.bashrc:

# Type "ne" to look up and edit an existing note, or create a new one
alias ne="notes.sh -l | fzf --tac --with-nth=\"2..-1\" --preview \"notes.sh -p {}\" --print-query --bind 'alt-enter:print-query' | xargs -o -d \"\n\" -n 2 notes.sh -f"

To add a new note:

ne

And then continue typing the note name and press Alt-Enter to create a new one.

To open a previously created note:

ne

Then select a note you want to open and press Enter.

License

Distributed under the terms of the BSD License