colorful rat Ratfactor.com > Dave's Repos

vviki

An AsciiDoc-flavored wiki plugin for Vim
git clone http://ratfactor.com/repos/vviki/vviki.git

Files

README.md

VViki

VViki Logo

Overview

VViki is a tiny AsciiDoc-flavored wiki plugin for Vim. It was inspired by link:https://github.com/vimwiki/vimwiki[VimWiki], uses Vim’s existing AsciiDoc syntax highlighting, and aims to be extremely lightweight.

Features / Usage

Install

VViki is in the standard Vim plugin structure. Any plugin installation method (incuding popular plugin managers) should work. If you have additional installation instructions to add here, I’ll gladly add them:

Vundle

Add this to your plugin list (in your .vimrc file):

Plugin 'ratfactor/vviki'

Then run :source % and :BundleInstall.

Setup

Add something like this to your ~/.vimrc file (or equivalent):

" VViki setup - relies on the default wiki root dir (~/wiki)
nnoremap <leader>ww :e ~/wiki/index.adoc<cr>

The above mapping will open a page called index when you type ‘ww’. (Vim’s default leader key is ‘\’. If you’ve not changed it, you’d type type ‘\ww’.) Users coming from VimWiki will be familiar with this mapping.

Note: VViki does not currently create directories, so you’ll need to create ~/wiki if it does not already exist.

Advanced Setup

By default, VViki uses ~/wiki as the wiki “root” directory and looks for pages having an .adoc extension. Any file under this directory (or subdirectory) ending in .adoc will be detected as a wiki page.

Here’s a setup example which changes the root directory and extension:

" VViki setup
let g:vviki_root = "~/secret_diary"
let g:vviki_ext  = ".txt"
nnoremap <leader>ww :e ~/secret_diary/index.txt<cr>

See :help vviki for complete documentation and specifically :help vviki-configuration for all settings.

Why?

I love link:https://github.com/vimwiki/vimwiki[VimWiki]. I also love AsciiDoc, but VimWiki doesn’t support AsciiDoc syntax. I put a day or two into adding full AsciiDoc support to VimWiki, but eventually concluded, “it would be faster just to create my own plugin.” And it was!

VViki aims to “do one thing and do it well”. This table explains the difference:

Feature VimWiki VViki
Wiki functionality X X
Syntax highlighting X
Tooling (search, HTML export, etc. X

Testing

Running the interactive test script is an easy way to try out VViki’s basic functionality without setting up or installing anything. VViki does not even need to be installed as a plugin!

To go from nothing to trying out and testing a wiki, try this:

git clone https://github.com/ratfactor/vviki
cd vviki
vim -S test/test.vim

The first test document should open immediately. It contains instructions for using the tests (shortcut keys are mapped for fast/easy usage). All tests are self-documented.

TODO

License

MIT License

Copyright © 2020 Dave Gauer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.