Recently I built a simple zettelkasten system using vim and Ruby's rake
library. This was an exercise in personal software.
Zettelkasten is a method for keeping hyperlinked notes. Its goal is to organize ideas and enable connections through the hyperlinks. If you like these kinds of things, I encourage you to read the link above or in the references. You encode the link by create a text timestamp.
You can easily implement this system by using tiddlywiki or something similar. I used tiddlywiki for years for my todo lists. It is great software. Yet over the years I migrated to using mostly vim. I also wanted a do a small software project, so I went ahead and created my own.
I wanted to try it out using my main writing tool, vim. I did some research to see if I could hyperlink to other files in vim. I can, using c-tags
, a vim feature where you create an index for string you want to hyperlink to. Then you use ctrl-[
when the cursor is on the text. Vim will take you to the file.
I started doing all of this by hand. It quickly got out of hand. I wanted to automate the creation of the cards and the indexing. I reached out to Ruby's rake
library. There are some other similar libraries floating around. I know rake
, I wanted to focus on getting things done, so I used rake
, rather than learning a new library.
The Rakefile has a few tasks. I can create new zettel cards, I can create an index file, and create tags. The rakefile assumes that there are some directories. The Rakefile is about 200 lines of code. It is easily hackable.
It is not a complete solution. But it mine. It adapts closely to how I am currently working. It is successful enough that I have integrated the zettel system into my blog, so that I can easily nagivate between notes and writing tech articles.
You can explore the code here