Monday, February 9, 2015

Personal organizer with vimwiki

vim text editor logo

Emacs users enjoy org-mode as super organizer of personal notes, documentation, diary, tasks list and many other things. And I wanted the same features for Vim and recently I found it. Welcome vimwiki as your personal organizer. Here is the list of features, what you can do with vimwiki plugin:
  • Organize notes in multiple wiki files.
  • Link your ideas/notes with quick wiki links.
  • Manage to-do lists.
  • Write documentation with rich formatting.
  • Use tables to organize data.
  • Memorize events in diary.
  • Generate HTML from wiki files.
  • Multiple wiki support.

Install

As usual, use following Git repository to install plugin with Pathogen:
https://github.com/vimwiki/vimwiki
Then you need to register wiki folders:
let g:vimwiki_list = [{'path': '$HOME/Documents/wiki'}]
In order to enjoy synchronization between all my devices, I shared this folder with BitTorrent Sync.
Also I put additional convenient settings into my ~/.vimrc:
  • let g:vimwiki_dir_link = 'index' - automatically resolve folder links as folder/index.wiki
  • let g:vimwiki_hl_headers = 1 - highlight headers with different colors
  • let g:vimwiki_hl_cb_checked = 1 - highlight completed tasks

Key bindings

  • <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

Organize notes

Any time when you need to open vimwiki you can just type <Leader>ww and vim opens index wiki file in the current buffer. See key binding to open vimwiki in a new tab or split window.
If you want to place a note to separated wiki file, then just type a name of wiki file (SomeWikiNote) or type a wiki link ([[Some wiki note]]) and hit <Enter> on it. Vimwiki automatically creates a new wiki file and opens it in the current buffer. Hit <Backspace> in order to return to previous wiki file.
Vimwiki supports all necessary markups for creating rich notes.
There are a few typefaces that gives you a bit of control over how your text should be decorated:
  *bold text*
  _italic text_
  ~~strikeout text~~
  `code (no syntax) text`
  super^script^
  sub,,script,,
Define logical sections with headers:
= Header level 1 =
== Header level 2 ==
=== Header level 3 ===
==== Header level 4 ====
===== Header level 5 =====
====== Header level 6 ======
Combine list of items with bulleted, numbered and mixed lists:
  * Bulleted list item 1
  * Bulleted list item 2
    * Bulleted list sub item 1
    * Bulleted list sub item 2
   
  # Numbered list item 1
  # Numbered list item 2
    # Numbered list sub item 1
    # Numbered list sub item 2
or definition list:
Term 1:: Definition 1
Term 2::
:: Definition 2
:: Definition 3
Collect table data with :VimwikiTable command:
 | Year | Temperature (low) | Temperature (high) |
 |------|-------------------|--------------------|
 | 1900 | -10               | 25                 |
 | 1910 | -15               | 30                 |
 | 1920 | -10               | 32                 |
 | 1930 | _N/A_             | _N/A_              |
 | 1940 | -2                | 40                 |
Store code snippets with preformatted blocks:
{{{python
def hello(world):
    for x in range(10):
        print("Hello {0} number {1}".format(world, x))
}}}
Text started with 4 or more spaces is a blockquote.
4 or more dashes at the start of the line is a 'horizontal line' (<hr />): ----
Mathematical formula are highlighted, and can be rendered in HTML using the powerful open source display engine MathJax (http://www.mathjax.org/).
You can have todo lists -- lists of items you can check/uncheck. Consider the following example:
= Toggleable list of todo items =
  * [X] Toggle list item on/off.
    * [X] Simple toggling between [ ] and [X].
    * [X] All list's subitems should be toggled on/off appropriately.
    * [X] Toggle child subitems only if current line is list item
    * [X] Parent list item should be toggled depending on it's child items.
  * [X] Make numbered list items toggleable too
  * [X] Add highlighting to list item boxes
  * [X] Add [ ] to the next created with o, O and <CR> list item.
Pressing <C-Space> on the first list item will toggle it and all of its child items. <C-Space> adjusts parents items also. It is possible to toggle several list items using visual mode.
See extensive help for markup syntax :h vimwiki-syntax .

2 comments:

  1. Thank you for providing this quick introduction to such an awesome plugin!

    ReplyDelete
  2. This is very much appreciated!! Thank you!!

    ReplyDelete