My notetaking system (znotes)

I've used my own hand-rolled artisanal notetaking system for most of my work, for almost a decade. Here's a few takeaways. (If you're a notetaking veteran, my guess is that the most interesting section for you would be "6. Contexts".

1. Background

Like many, I've always been interested in "tools for thinking". I read Lion Kimbro's "How to Make a Complete Map of Every Thought You Think", mourned for the Xanadu that I never knew, dabbled with nvALT and Roam and such. I've also made some tools for thinking parathesizers of various kinds.

To me, the ambition and the potential is large; but in practice, we mostly get just a tweaked file system. This is understandable: actually supporting real thinking is a different and probably much more difficult project, which would involve iteratively interviewing thinking itself about what it would need to progress better.

I had some of these hopes with my notetaking system, so there was a lot of experimentation and also strange design choices. For example, at the beginning I was trying to make transclusions work, which is both somewhat pointless maybe and also didn't work. I won't go into this.

But, out of the shuffle of boondoggles, there were a few useful ideas that I still use regularly and get value from.

2. nvim

This isn't an idea, but just so it's stated: I pretty strongly recommend using nvim, if you can stomach the precipitous learning curve and customization requirements. Modal editing, the vim keyboard commands, macro recording, extensibility—these things are too powerful to leave on the table if you can get them. [Emacs is kinda like nvim, but harder to set up. ;) ]

3. Colors

Each file in my system gets randomly assigned a fixed color (by hash of its filename). Many colors are ruled out, so that the available colors are bright enough. Text in the files is displayed in that color. Also, when a preview of the file is shown in search, and when the title is shown in a link from another file, the text is in the target file's color.

This has a few benefits:

  1. It's somewhat less boring than monocolored text. It feels cool, like there's lots of different stuff happening in the system overall; I intuitively feel like I'm moving around between working on different things. But it's not distracting, because each file is within itself monocolored (except for links to other files).
  2. Open a new file —> new color! New field, new thoughts, new mode.
  3. The color helps recognize the file. E.g. if I open a file (from a search, say), it's a fast obvious cue whether I got the right file; or if I'm moving my cursor between files; or if I'm looking for the link in another file.
  4. It's possible that it helps evoke the context / feel of a given document a bit better, I don't know.

4. Links

It almost goes without saying that links between files are useful. Here's the criteria for a full link implementation:

  1. The link points to the file by filename.
  2. The link displays using some other text, the "title" of the file (in my case, the first line of the file).
  3. When the title of the file is changed, the display of links to that file also change automatically, while the link itself still points to that same file.

I think meeting all these criteria is surprisingly rare. My system almost but does not actually do it, and several other systems don't. Links like [[file name]] don't satisfy the criteria. (Why have these criteria? Because you want to change the titles of things without manually changing links, and you might have automatic filename generation (as I do), and might want to avoid changing filenames (as I do).) It might be that some html-based systems do this—but then, they will fail to get all the huge benefits of being in nvim.

5. Scripts

This is more like a workflow in nvim than an idea, but it's pretty useful for me. Basically, I write vim scripts and python scripts in files in my notetaking system, and then (in another file in my system) define nvim commands to invoke those scripts, and then iterate on those scripts while calling them on work material. This makes it easy to develop the scripts quickly, and to save useful macros, without even switching to some spot in my nvim configuration or anything. For example, this is how I tune my scripts for converting my markdown notes into html / LessWrong / pdf.

6. Contexts

Maybe my most interesting contribution is contexts (and cycling). The point of contexts is basically what it sounds like: to track and preserve context of what you're working on.

In my system, a context does a few things:

  • Shows up in the search bar when I search for contexts (see image above).
  • Has a name, e.g. "intelligence amplification".
  • Can be on or off (default off unless I enter it manually).
  • While that context is on:
    • It tracks which files are edited or created.
    • The file search only shows files in that context (unless I type .a, meaning "search all").
    • Cycling. There's two keys where if I press them, the file that I'm currently in will switch to the next file (by creation date) out of files that are in this context.
  • When I exit a context, it saves the arrangement of windows and files I have open and where my cursor is (using nvim sessions). The next time I enter that context, it loads that arrangement.
  • It can have subcontexts, which work like you'd expect.

(Of course files can show up in multiple contexts. waow)

All these features are helpful for having separate contexts focused on one topic, without much bookkeeping. Since switching contexts takes only a few keypresses (3-5ish), it's actually a solid way of noting things down for later without disrupting workflow.

Note that cycling can probably be generalized to cycle through other orderings for other keypresses. For example, you could have a "scrap/notes" function which, for any file, either creates or goes to the corresponding "scrap/notes" file, or toggles back to the main file.