home | tags


Zettelkasten – my version/vision

tags: #cli #expert

The basic idea of Zettelkasten (zk) is:

Except for the last one, I don’t see why someone who knows, uses, (and loves!) :Rg, :Files, and their cousins 1, needs a complicated tool for zk.

Atomic sections

My notes are “atomic” at the “section” level. I dislike the sprawl that results when you have thousands of notes, especially when many of them are connected in not just a loosely connected fashion, but in a more structured, sequential (e.g., time-ordered) or hierarchical manner.

Each of these md files has sections, usually H2 or H3 level, so you could say, in my version of “Zettelkasten”, each of those sections is a zk “atomic note”.

Examples from my zk…2

Tags (or indeed any word or phrase!)

Trivial: Just use #foo or whatever. Then hit alt-r (needs 4 lines in your vimrc; see the vimrc section of my codeberg repo for details.

Same for any word.

For a phrase, just visually select (v) the phrase and hit alt-r (again, see the vimrc lines).

For files, trivial: just visually select a partial filename and hit alt-f (needs 2 lines in your vimrc; again, see this section).

But in my system, a “file” is not just one note, a section is. And that devolves to what we use above for tags.

Seriously check out the demos listed in the footnote below; once you discover how powerful this combination of tools is (and especially fzf), you will never look back.

However, for convenience, I’ve wrapped vim’s :Rg into a simple script, which also includes a couple of other conveniences (see below for one more example).

The code and documentation are here.

Adding a new entry

Technically, this is not needed. If you know how :Rg works, then you know that when you hit Enter on a particular line, it opens vim at that line. Then you can just type away, either adding new content or a new section, whatever.

Again, for convenience, I do have a way to start adding a new entry after a given section.

For more details see the code and documentation.


Footnotes


  1. For those of you who don’t know this, they are vim commands enabled by installing fzf, ripgrep and the fzf.vim plugin. They are absolutely amazing, and you should check out some quick demos, like this, or about 30 seconds of this, or about 20 seconds of this.↩︎

  2. Example time! I have a directory called “techknow” which contains all my notes on technology. There’s a reasonably natural division there, based on technology; e.g., android, linux, networking, telecom, tools. And in some cases there’s one more level; e.g. linux has subtopics containers, desktop, memory, performance, security, etc. “Tools” is one of the largest; a small sample is bash, caddy, csvtools, hashtools, dupfinders, ffmpeg, … and a lot more.

    And this applies to other stuff also. Quick summaries of medical reports go into medical/<name>.md for me and my wife. Money-related notes go into “fin/bank.md”, “fin/demat.md”, and such.

    I am also an aspiring writer of Harry Potter fanfiction :) I have about two hundred writing prompts: long fiction ideas get individual files, short fiction outlines go into files categorised by either the main character’s name or a type (funny, clever, violent, tech-heavy (I like Harry/Hermione using muggle technology to beat Voldemort), while useful snippets go into another, using tags that may overlap with the category filenames.↩︎