A while back, I was looking for a tool to act as basically a semi-organised dumping ground for all sorts of notes and thoughts.
I wanted it to be Free software, easy to keep in sync / use across multiple devices, I can use it offline / without a LAN connection, and it should render Markdown nicely.
I looked at logseq, which looked interesting, but decided to give vimwiki a go. I spend a lot of my time in vim already, so this seemed like it would fit into the way I work very easily.
And I was right. Since it is “just” a collection of .md files, it appeals to me from a simplicity point of view, and also makes synchronisation and backing up very easy.
Installing it
There are [multiple ways to install vimwiki].
I went for:
git clon...
A while back, I was looking for a tool to act as basically a semi-organised dumping ground for all sorts of notes and thoughts.
I wanted it to be Free software, easy to keep in sync / use across multiple devices, I can use it offline / without a LAN connection, and it should render Markdown nicely.
I looked at logseq, which looked interesting, but decided to give vimwiki a go. I spend a lot of my time in vim already, so this seemed like it would fit into the way I work very easily.
And I was right. Since it is “just” a collection of .md files, it appeals to me from a simplicity point of view, and also makes synchronisation and backing up very easy.
Installing it
There are [multiple ways to install vimwiki].
I went for:
git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugin
vim -c 'helptags ~/.vim/pack/plugins/start/vimwiki/doc' -c quit
and then adding the following to my ~/.vimrc (although I already had one of them):
set nocompatible
filetype plugin on
syntax on
Using vimwiki
To add a new wiki with support for Markdown (rather than the default vimwiki syntax), I put the details into ~/.vimrc
let g:vimwiki_list = [{ 'syntax': 'markdown',
\ 'ext': 'md',
\ 'path': '~/briefcase/Store/vimwiki/'}]
Then, I opened vim, and used \ww to open the wiki. On the first use, there was a prompt to create the first page.
Keybindings
The basic vimwiki-specific keybindings are indeed the ones I use the most to manage the wiki itself.
For me, “” is ““.
<Leader>ww -- Open default wiki index file.
<Leader>wt -- Open default wiki index file in a new tab.
<Leader>ws -- Select and open wiki index file.
<Leader>wd -- Delete wiki file you are in.
<Leader>wr -- Rename wiki file you are in.
<Enter> -- Follow/Create wiki link.
<Shift-Enter> -- Split and follow/create wiki link.
<Ctrl-Enter> -- Vertical split and follow/create wiki link.
<Backspace> -- Go back to parent(previous) wiki link.
<Tab> -- Find next wiki link.
<Shift-Tab> -- Find previous wiki link.
Otherwise, I just use vim normally, which is a significant part of the appeal for me.
Syncing via Nextcloud and git
The wiki is just a collection of markdown files, in the directory specified in the “path” field in the configuration.
This makes synchronisation easy. I sync my vimwiki directory with Nextcloud, so that it propogates automatically onto my machines, and I can also push it to git, so that I can grab it on my phone.
This works for me, and means that I don’t need to configure, secure etc. another sync tool or a dedicated sync system.
Multiple wikis
There is support for multiple wikis, although I have not experimented much with this.
Each wiki gets its own line in ~/.vimrc.
You can use \ws in vim to select which wiki you want to use.
I like it!
I really like vimwiki. It is simple but effective, and because it runs in vim, it does not require me to learn a different tool, or adjust my workflow. I just open vim and open my wiki.
Prior to vimwiki, I was just dropping .md or .txt files into a directory which got synchronised, so this is not massively different, other than more convenient. Everything is still file-based, but with an increased ease of organisation.
For someone who didn’t already use vim, it is probably a more challenging choice.