7.6 KiB
title | description | tags | date |
---|---|---|---|
My note taking setup | This post presents the tools I use to take everyday notes | zettelnotes, vim | 2022-10-27 |
In this post I present the setup I use to keep notes of ideas, notions etc. It uses vim with a selected set of plugins, to achieve a minimalistic implementation of the Zettelkasten method.
An overview of Zettelkasten
Behind this name lies a simple idea: instead of trying to classify notes in folders, or by tag and being limited by one particular classification, let the notes all live in a same large box and just be interested in the metadata: which notes link to which.
This way of keeping notes seems to be quite popular right now, and I must say I liked the idea that a note could just be dumped in a folder with just a few links to other notion to make it have its importance. I really lightens the burden of starting the process of writing something as it does not have to be classified yet, but will just classify itself in the process.
So, what properties should a Zettelkasten system have?
- Each note must have a unique identifier, to be unambiguously referenced.
- It should be easy to reference a note in another.
- It should be easy to look for an existing note with full text searches.
- Ideally, it should be easy to have access to notes that point to a particular note (find backlinks).
- The full graph structure of the notes should be accessible.
At the time of writing, the last point is not yet implemented but the others are, to some extent.
Core vim plugins
At the core of this system is really one plugin by Michal Hoftlich who did all the work with vim-zettel. This plugin takes care of all the necessities: the four first points of the bullet list above. It depends on other plugins too:
- vimwiki which allows to work with a wiki structure in
vim
, - fzf.vim to make full text fuzzy searches in notes
Once all of those are installed, here are a couple tweaks I made:
vim-zettel options
For the unique identifier, I chose to have a timestamp in front of the note title. Each note is then a md
file with a yaml
frontmatter that contains useful information:
- the note title,
- the date and time of creation,
- a type, which is generally "note", but can have other values (see below)
After this frontmatter, there is a list of "tags" which are just links to other notes that can have a more general subject. This should allow for some structure emergence later on. Then the title, the note contents, and finally some references which would be pointing to particular resources: books, articles, videos etc. This default format is defined in a template note which vim-zettel will use upon creating a note.
For full text search, instead of choosing the default silver searcher, I configured vim-zettel to call ripgrep as it is what I had already installed.
Additionally, I configured some useful keybindings to create a new note, open an existing one, include a reference to a note and add the backlinks to a note. All these functionalities are offered by the plugin and I merely assigned some keys to call them.
vimwiki options
For vimwiki, I chose to use the markdown
syntax as it is not the choice by default, added the markdown
filetype to the created files (by default they only have a vimwiki
filetype), and disabled some mappings to navigate links as they used the <tab>
key and I needed it to expand snippets.
fzf options
I left fzf mostly untouched, and just added a keybinding to look for available snippets, with a cheatsheet purpose.
Convenience vim plugins
To make the setup enjoyable to use I also added some convenience plugins:
- Snippets with ultisnips which allow to expand some keywords to recurring patterns. I use it for sections, links, formatting and such.
- AutoComplPop which just pops the completion menu automatically. Useful to auto complete words.
- PaperColor theme, in its dark variation, purely aesthetic.
- Goyo which makes vim's interface very minimalistic: no bars, no line numbers, centred text and that's it.
- vim-markdown which makes working with
md
files so much easier.
I plan to also add vimwiki-sync as it would allow me to easily sync my notes between different computers.
And really that's it!
Typical workflow
Note types
OK, so how do I typically use this setup? At the moment, I find I conceptually distinguish between three types of notes (also they are all located in the same folder):
- plain notes: short, on the fly, written down ideas. They are the core of the process. Their type is
note
. - references: those are special notes pointing to an external resource. I can either make one by hand, or I automated crafting them directly from firefox (see below). Their type is
ref
. - hubs: those special notes are not new ideas but are notions that are pointed to by a lot of other notes. At the moment I am sill unclear how to gracefully deal with those, but I have some clues. Their type is
hub
.
New notes
When I have an idea I will fire up vim with the note taking vimrc
setup (I aliased it to ztl
), and I can create a new note and write down the idea. I can also start by looking if a note with a similar idea doesn't already exist, or point to related notes while writing.
I try to keep the notes short, and limited to one idea, as is recommended by the Zettelkasten system. It also makes it way less intimidating to write a note!
Tags and hubs
In each note, I also have a "tags" line, in which I write keywords relating to the idea. If I'm sure the keyword has never been used I just write it plain and (in normal mode) then press Enter
so that vimwiki transforms it to a link. Enter
again and I can open up the link and just save it in place. It creates an empty file with the name of the new tag.
If, however, I think or know I have created the note before I can look for and link to it with vim-zettel. I can also directly reference another note in the tags if the subject is similar.
After some time, I should see the importance of different tags emerge, as being pointed to by many notes. At which point I can open this particular note, and if it is empty give it the hub
status with some words on the meaning of the hub, and possibly a list of backlinks pointing to that hub.
References
To add new references, typically in the form of an online article, I installed the BibItNow firefox extension, which is an easy way to create bibliographic references from online pages or articles. I wrote myself a template (ref.bnfa
) that I can import in BibItNow that would present the information as a note with type ref
. That way, I just have to press Alt+Q
on a page I want to keep a note of to download it as a new reference.
To have a good filename I tweaked the BibKey settings so that the created reference can be readily saved in my notes.
How to use
My source files are accessible on this repo. Feel free to grab them and have a look! To replicate the system:
- Dependencies: vim (possibly neovim), rg.
- Launch
vim -u path/to/vimrc -c PlugInstall
, and vim should take care of everything. - Just call
vim -u path/to/vimrc
to enter the note taking environment!