sudoedit.com!

How to install vimwiki in neovim

As I mentioned a couple blog posts ago, I like to keep a personal knowledge base and I've been trying to move away from commercial cloud products like Evernote.

Not because there is anything wrong with Evernote or other note taking apps, but because I think plain text is a superior format due to its overall flexibility.

The best tool I've found so far to help me stay organized with my personal writing is vimwiki. It's a vim plugin that will allow you to keep a personal wiki in vim. Or in my case neovim because that is what all the cool kids are using these days.

Step 1 - install neovim

I'm old fashoned so I just use my package manager. Though I should note there is an appimage version available for those of you who are too fancy pantsy for package managers 🤠.

Ubuntu based

sudo apt install neovim

Fedora

sudo dnf install neovim

Neovim has install instructions for several operating systems on their github.

Install vim-plug

vim-plug is a package manager for vim (or in this case neovim) plugins.

Installation instructions for vim-plug with neovim can be found on their github page.

The meat and potatoes of those instructions is the following (assuming you are on Linux):

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

This will download the vimwiki files from github to your neovim plugin directory.

Create your neovim configuration file

If you haven't been using neovim you'll need to create a configuration file.

mkdir -p .config/nvim/
nvim init.vim

Then add at least the following lines:

set nocompatible
filetype plugin on
syntax on
call plug#begin()
Plug 'vimwiki/vimwiki'
call plug#end()
let g:vimwiki_list = [{'path': '/path/to/my/wiki/',
                      \ 'syntax': 'markdown', 'ext': '.md'}]

The final line in this file is assuming you want to write in markdown... because who isn't writing in markdown these days? But it isn't necessary you can end the list before the 'syntax' parameter and use the wiki format.

Install vimwiki

Open neovim: nvim

And run the following command:

:PlugInstall

vim-plug will open a split and you'll be able to see the progress of the vimwiki installation. Once it's complete congratulations! You've installed vimwiki and can start creating your own plain text knowledge base with neovim.

Read the docs and start your wiki

Read the introduction documents for vimwiki https://github.com/vimwiki/vimwiki#introduction and start setting up your notes.


If you found this useful please support the blog.

I use Fastmail to host my email for the blog. If you follow the link from this page you'll get a 10% discount and I'll get a little bit of break on my costs as well. It's a win win.


Backblaze

Backblaze is a cloud backup solution for Mac and Windows desktops. I use it on my home computers, and if you sign up using the link on this page you get a free month of service through backblaze, and so do I. If you're looking for a good backup solution give them a try!

Thanks!

Luke

#Linux #vim