wikivim
Configuration
Here there are many options that overlap with Vimwiki:
g:wiki_root
: specify root path of wiki filesg:wiki_filetypes
: specify list of filetypes to enable the wiki withg:wiki_map_link_target
: specify a transformation to file names when creating a file. This is useful, but a lot of my filename creation happens outside of any wiki plugin.g:wiki_link_target_type
: choose link style (I’ve set this tomd
)Wiki journal defaults:
let g:wiki_journal = { \ 'name': 'journal', \ 'frequency': 'daily', \ 'date_format': { \ 'daily' : '%Y-%m-%d', \ 'weekly' : '%Y_w%V', \ 'monthly' : '%Y_m%m', \ }, \}
g:wiki_file_open
: specify a function for opening file URLs, namely to handle certain file types with specific applications. I’ve had to specify PDF programs as the defaultxdg-open
option hasn’t been working for me.
Default Mappings
n
ww | (wiki-index)| [GLOBAL] n
wn | (wiki-open)| [GLOBAL] n
w w | (wiki-journal)| [GLOBAL] n
wx | (wiki-reload)| [GLOBAL] n
wc | (wiki-code-run)| n
wb | (wiki-graph-find-backlinks)| n
wg | (wiki-graph-in)| n
wG | (wiki-graph-out)| n
wf | (wiki-link-toggle)| n
wd | (wiki-page-delete)| n
wr | (wiki-page-rename)| n
wt | (wiki-page-toc)| n
wT | (wiki-page-toc-local)| n
wp | (wiki-export)| x
wp | (wiki-export)| n
wlu | (wiki-list-uniq)| n
wlU | (wiki-list-uniq-local)| n
wsl | (wiki-tag-list)| n
wsr | (wiki-tag-reload)| n
wss | (wiki-tag-search)| n
| (wiki-link-next)| n
| (wiki-link-open)| n
| (wiki-link-open-split)| n
| (wiki-link-prev)| n
| (wiki-link-return)| n
gl |(wiki-link-toggle-operator)| ni
| (wiki-list-toggle)| x
| (wiki-link-toggle-visual)| ox
au |(wiki-au)| ox
iu |(wiki-iu)| ox
at |(wiki-at)| ox
it |(wiki-it)| ox
al |(wiki-al)| ox
il |(wiki-il)|
Commands
Many commands also overlap with Vimwiki, including opening files, going to the wiki index, and going to a journal entry. New ones include
WikiGraphFindBacklinks
: list backlinks in a location listWikiGraphIn
/WikiGraphOut
: show link graph in/out of the current page
There are also similar navigation commands between pages (by default WikiRename
and WikiDelete
commands. There are also some interesting looking journal commands:
WikiJournalToWeek
: go to weekly summary, parsing day entries if non-existentWikiJournalToMonth
: go to monthly summary, parsing day and week entries if non-existent
So there appears to be a way to create week and month level journal entires, which is great.
Search
The plugin supports basic functionality for both the CtrlP plugin and the fzf plugin. This includes a tag search (WikiFzfTags
), page search (WikiFzfPages
), and in-page TOC search (WikiFzfToc
). This last one is great for long files; you can easily see all the headings and jump to that spot quickly. This of course is lacking line search support, but we’ll wait and see how that can work out.
Links
Links are specified by a [scheme:]address
format, where scheme
determines the type of link and address
is the target location. Of course, markdown links []()
can be used to link to any internal pages, but so can the scheme wiki:<target file>
or journal:<date>
. Additionally, actual system files can be linked using the file:<filename>
scheme. This last feature is quite cool, allowing me to reference documents stored in my sites docs/
directory even from within Vim and open them natively.
Viewing links
Can use WikiLinkShow
command to view details relevant to the current link. This includes the link type, source, target, etc (many more metadata attributes have been added in the wiki.vim fork).
Reference Links
Something I haven’t seen before (although know they exist in markdown) is reference links. These allow pieces of content to reference a link elsewhere; they are a lot like inline citations. The following example shows usage:
[1]
The most basic usage references a single name.
We can also reference a description and a target, and only the target is referred later.[desc][target]
[1]: <link1> [target]: <link2>
Anchors
Anchors are supported by default within wiki links. For example, the following link will take me back to the configuration part of this document: config. This is very handy, and can also be seen with TOC generated in-file with the WikiPageToc
command.