A simple Zettelkasten setup using Vim + FZF + Ripgrep
The zettelkasten (German: "slip box") is a knowledge management and note-taking method used in research and study.
The zettelkasten method consists of taking multiple individual notes, tagging and relating them together, in order to build a private knowledge base.
I was inspired by this post, and by how the author built his own setup using Unix tools. I wanted a similar, but slightly different setup. By the way, his work is also on Github
Each zettel (probably not a real world, but I'll use that to refer to each individual note) is a markdown file, named with a timestamp and a title.
Zettels can have tags (e.g.: #programming
, #quote
, #really-good-advice
), as well as sources (e.g.: @tim-ferriss
,
@mom
, @myself
).
They're otherwise plain markdown files, write whatever you want, in whatever format you wish. Here's a sample:
# 2020-07-17-11-30-optimization.md
Premature optimization is the root of all evil
**I opted to use markdown italic syntax for personal comments**
#quote #programming
@donald-knuth
You can then navigate your knowledge base by searching for tags, sources, or just plain full-text search.
All of this is powered by:
More tooling may be added down the line, but for now this simple setup serves me well.
-
Make sure you have the
fzf
,rg
commands working on your shell, as well as the fzf.vim Vim plugin. -
Clone the repo to some place:
git clone git@github.com:naps62/zk $HOME/.zk
- Add the
bin
directory to your path
# add this to your .bashrc / .zshrc / .whateverrc
export PATH="$HOME/.zk/bin:$PATH"
- Setup the needed
$ZK_PATH
variable, pointing to where you want your knowledge base to be:
# add this to your .bashrc / .zshrc / .whateverrc
export ZK_PATH="$HOME/zettelkasten"
- Start using it
# create a new zettel
$ zk new "An Awesome Quote"
# search by tags
$ zk tags
# search by sources
$ zk sources
# full-text search the entire zettelkasten
$ zk search
# get help
$ zk help
Feel free to do so.
Pull requests, issues, or even a tweet is welcome.