Vimwiki

Vimwiki notes

Basic Navigation

Repo main doc file here

  • \ww - open wiki index

  • \wt - open wiki index in new tab (tabs exist? cool)

  • \ws - select and open wiki index file (prompts wiki number, used for multiple wikis)

  • \wr - rename current wiki file

  • \wd - delete current wiki file

  • <enter> - create and follow wiki link (will automatically wrap word in “” if not already)

  • <shift-enter> - split and follow/create wiki link (split?)

  • <tab> - go to next wiki link

  • <shift-tab> - go to previous wiki link

  • <backspace> - go back to previously visited page

  • [[ - go to previous header in buffer

  • ]] - go to next header in buffer

  • <ctrl-space> - toggle current list item as checkbox

  • gln - increase done status of checkbox

  • glp - decrease done status of checkbox

  • gll - increase level of list item

  • glh - decrease level of list item

  • :VWS /pattern/ - search for pattern across wiki

  • :VWB - search for wiki links to current page

  • :VimwikiGenerateLinks - insert links of all wiki files to current buffer

  • :VimwikiTOC - create/update table of contents of current wiki file

  • :VimwikiSearchTags - search over locations with given tag (supports autocomplete)

  • So called “omni complete”: <ctrl-x> <ctrl-o> to activate an autocomplete dropdown with wiki link (doesn’t work so well for Markdown syntax)

Settings

The following are some relevant settings that I currently have in my .vimrc:

  • path: controls where wiki files are created; currently set to ~/Nextcloud/vimwiki so my wiki files are automatically available from my cloud
  • syntax: specify syntax other than the default wiki syntax; current set to markdown, along with the ext: '.md' setting for writing files in Markdown
  • links_space_char: controls what character to replace spaces with when creating wiki files; currently set to ‘-’

Tasks

By default, only simple checkbox lists are supported:

  • Task not started
  • [.] Task 1-33% completed
  • [o] Task 34-66% completed
  • [O] Task 67-99% completed
  • Task completed

Much greater task integration can be seen in Taskwiki, a complementary plugin that integrates with TaskWarrior.

Anchors

Every header, tag, and bold text can be used as an anchor. This is automatic; all you need to do is type the # after your wiki file and before the anchor phrase. Anchors support omni complete, you can easily search for the anchor you want to fill. Here are a few examples:

  • index - links back to a section on the index (NOTICE: Markdown space filler is messing this up)
  • #Settings - map back to the settings header in this file (note no file name need be specified)

Just typing out these examples, it’s clear there are a few problems. The Markdown space setting is messing up hitting <enter> on anchored links, and again autocomplete sucks for Markdown links. Hopefully these are areas that can be addressed at some point.

Tags

Files, headers, or arbitrary locations can be tagged.

  • The whole file is tagged if a tag is placed within the first two lines of the file.
  • A header is tagged when a tag is placed within two lines below the header.
  • Otherwise the tag can be placed anywhere in the document.

Tags look like :tag: or :tag1:tag2: for multiple tags. Tags must be a sequence of non-space characters. Tags are useful because Vimwiki allows you to search through and jump around tags across the wiki easily. Of course you could use :VWS to search related terms across the wiki, but a tag search allows you find those locations deliberately set for a particular keyword. Tags also support omni completion with <ctrl-x><ctrl-o>. Tag metadata needs to be updated with :VimwikiRebuildTags before all tag locations are indexed properly.

Tables

Vimwiki tables mimic the prominent auto reformatting feature of org mode tables. This is fantastic.