nb: A Note-taking Solution That Doesn't Suck
I'm pretty sure I've tried every digital note-taking system that has ever been created. Evernote, OneNote, Apple Notes, Joplin, Obsidian, probably a dozen more that I can't even remember at this point. I've never been very satisfied with any of them. My note-taking system needs are pretty simple: plain text, in flat files. I should be able to:
- open my notes in any text editor, on any operating system
- organize them in any structure I choose
- search through them with familiar tools like
grep
- encrypt them with familiar tools like
gnupg
- version and synchronize them with familiar tools like
git
, between systems under my control - format them in familiar markup languages like Markdown
In other words, I think there is no need to reinvent the wheel to create a digital note-taking system. The popular note-taking systems listed above fail pretty miserably across the board in this regard.
Evernote and OneNote: Classic feature-creep bloat, proprietary lock-in and synchronization, no Markdown support, despite this seven-year-old still-active thread requesting it in Evernote. Desktop clients only work on certain operating systems.
Apple Notes: Somehow simultaneously bloated and too simple. Unsurprisingly Apple-only, and the web version of iCloud depends on WebGL for "acceptable" performance, which even then I think it does not achieve.
Joplin: Electron bloat, uses a database instead of flat files, synchronization can only be done with Dropbox/Nextcloud/WebDAV, encryption feels kind of wonky.
Obsidian: the least bad option (and has some neat GUI renderings with linked notes) but that comes with a lot of Electron bloat.
Enter nb
I don't remember how I found nb, but I'm very glad I did! It is the note-taking tool for command-line power users that easily meets all of my note-taking needs and then some: nb
seamlessly composes battle-tested programs and paradigms into very powerful note-taking features without opinionated bloat.
nb
"notebooks" are separate git repos that can be synchronized either with separate remotes or as orphan branches on one remote. I don't trust myself to not screw up the latter option, so I chose to go with separate remotes for every notebook. Because of this, I found it better to keep the number of notebook small — I chose just two, "personal," and "work." In any case, you can create any arbitrary directory structure in the notebook you want, so I do all of my subdivision under these two very broad notebook categories.
On the remote (in my case, a cheap Digital Ocean Droplet), I created my nb
remotes:
mkdir nb
git init --bare nb/personal.git
git init --bare nb/work.git
Then on my local:
nb notebook add personal
nb notebook add work
nb personal:remote set user@domain.com:/home/user/nb/personal.git
nb work:remote set user@domain.com:/home/user/nb/work/git.
That's pretty much all that's needed for setting up synchronization, and you could turn on auto-sync if desired. A nice bonus of doing synchronization this way is that you can selectively choose which notebooks to sync on a per-machine basis, (e.g. only sync your work notes on your work machine).
But What About Mobile?
OK, I admit, nb
isn't exactly "mobile-friendly" out of the box, especially for iOS (Termux seems like it could work for Android users). However, so far, I haven't really found this to be an issue. When I do need notes on my phone, it's almost always because I'm reading something like a shopping list or quick reminders. I hardly ever write notes of any substance on my iPhone, and when I really need to, the built-in Apple Notes is a fine solution as a temporary go-between. If a note is really important, I'll transfer it to an nb
notebook when I get home.
Another option that I'm considering is something like a post-receive git hook on my remote that uses pandoc to render out the markdown notes as HTML but again, so far, that hasn't really been a pressing need.