VimWiki is an excellent tool for creating both a personal knowledgebase and journal. I use it everyday to keep track of new techniques that I learn as well as to keep notes on how I perform tasks everyday. Because it is completely text based with minimal formatting, it is possible to share easily and keep in git version control for a full history of how and what I learn. In addition, the search feature allows me to quickly recall how to perform a task or find the information I need quickly.
Installation
1) Install vundle or download my dotfiles to get started with managing vim plugins
2) Install the VimWiki and Calendar plugins for vim by adding the following to your vundle file
Bundle 'mattn/calendar-vim' Bundle 'vimwiki'
3) update all of your plugins
vim +BundleInstall +qall mkdir -p ~/Documents/VimWiki/
4) Remap your leader key in your .vimrc . I set mine to ,
:let mapleader=","
To find your current leader key run
:echo mapleader
and it will appear in the bottom left
5) Add the the following to your .vimrc to get started
" vimwiki stuff " " Run multiple wikis " let g:vimwiki_list = [ \{'path': '~/Documents/VimWiki/personal.wiki'}, \{'path': '~/Documents/VimWiki/tech.wiki'} \] au BufRead,BufNewFile *.wiki set filetype=vimwiki :autocmd FileType vimwiki map d :VimwikiMakeDiaryNote function! ToggleCalendar() execute ":Calendar" if exists("g:calendar_open") if g:calendar_open == 1 execute "q" unlet g:calendar_open else g:calendar_open = 1 end else let g:calendar_open = 1 end endfunction :autocmd FileType vimwiki map c :call ToggleCalendar()
Using the Wiki Features
1) Start up Vim
2) The following command will take you to the top page of your wiki
,ww
3) select yes to create the new directory and it will take you to your new Wiki index
4) enter information
5) to make the text actual links surround with [[ ]]
6) Move up and down when the cursor is on the link you want Company Information in this case hit return and it will generate a new wiki page
7) add data to the page
8) go back to the main page by pressing the backspace key
Searching the Wiki
1) Search for the term “blog” by running the following command
:VWS /blog/
shows (1 of 2)
2) show all of the matches
:lopen
3) navigate up and down and hit return to select that file

Using diary
1) create a new diary entry and add data. If you add the == Title == at the top it will be visible in the index (next step)
,w,w
2) go to the diary index
,wi
3) build a diary index
:VimwikiDiaryGenerateLinks
4) using the calendar plugin to toggle on/off
,c
5) you can navigate to the date and hit return on that date and the diary entry for that date will open!
2 Comments
Zane Williamson · September 6, 2014 at 20:56
Thank you Chris! This primer is exactly what I needed.
Great · September 30, 2014 at 12:00
Great article, thanks!
I’m using vimwiki since a year now, and never knew about :VMS
Comments are closed.