colorful rat Ratfactor.com > Dave's Repos

vviki

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

vviki/README.md

Download raw file: README.md

1 # VViki 2 3 <img src="raw/vviki.svg" alt="VViki Logo"> 4 5 ## Overview 6 7 VViki is a tiny AsciiDoc-flavored wiki plugin for Vim. 8 It was inspired by link:https://github.com/vimwiki/vimwiki[VimWiki], 9 uses Vim's existing AsciiDoc syntax highlighting, 10 and aims to be extremely lightweight. 11 12 ## Features / Usage 13 14 * Hit Enter on a word to create a link 15 * Hit Enter on a link to edit that page (or open URL in a browser) 16 * Backspace opens previous page 17 * Tab jumps the cursor to the next link on the page 18 19 20 ## Install 21 22 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: 23 24 ### Vundle 25 26 Add this to your plugin list (in your `.vimrc` file): 27 28 Plugin 'ratfactor/vviki' 29 30 Then run `:source %` and `:BundleInstall`. 31 32 ## Setup 33 34 Add something like this to your `~/.vimrc` file (or equivalent): 35 36 " VViki setup - relies on the default wiki root dir (~/wiki) 37 nnoremap <leader>ww :e ~/wiki/index.adoc<cr> 38 39 The above mapping will open a page called `index` when you type '<leader>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. 40 41 Note: VViki does not currently create directories, so you'll need to create `~/wiki` if it does not already exist. 42 43 ## Advanced Setup 44 45 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. 46 47 Here's a setup example which changes the root directory and extension: 48 49 " VViki setup 50 let g:vviki_root = "~/secret_diary" 51 let g:vviki_ext = ".txt" 52 nnoremap <leader>ww :e ~/secret_diary/index.txt<cr> 53 54 See `:help vviki` for complete documentation and specifically `:help vviki-configuration` for all settings. 55 56 ## Why? 57 58 I love link:https://github.com/vimwiki/vimwiki[VimWiki]. 59 I also love AsciiDoc, but VimWiki doesn't support AsciiDoc syntax. 60 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! 61 62 VViki aims to "do one thing and do it well". 63 This table explains the difference: 64 65 <table> 66 <thead> 67 <tr> 68 <th>Feature</th> 69 <th>VimWiki</th> 70 <th>VViki</th> 71 </tr> 72 </thead> 73 <tbody> 74 <tr> 75 <td>Wiki functionality</td> 76 <td>X</td> 77 <td>X</td> 78 </tr> 79 <tr> 80 <td>Syntax highlighting</td> 81 <td>X</td> 82 <td></td> 83 </tr> 84 <tr> 85 <td>Tooling (search, HTML export, etc.</td> 86 <td>X</td> 87 <td></td> 88 </tr> 89 </tbody> 90 </table> 91 92 ## Testing 93 94 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! 95 96 To go from nothing to trying out and testing a wiki, try this: 97 98 git clone https://github.com/ratfactor/vviki 99 cd vviki 100 vim -S test/test.vim 101 102 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. 103 104 105 ## TODO 106 107 * [x] Absolute vs relative internal links 108 * [x] Make VViki a "real" plugin 109 * [x] Fix bug with description in link macros - need proper line parsing 110 * [x] Try using 'conceal' for syntax to display pretty links 111 * [x] Configurable wiki path 112 * [x] Configurable wiki file extension 113 * [x] Add default "index" files for "directory/" wiki paths 114 * [x] Start help doc 115 * [x] Finish help doc 116 * [x] Global setting to turn off link syntax conceal 117 * [x] Add <tab> key link navigation (jump to next link) 118 * [x] Release 1.0 119 * [ ] Wishlist: Consider creating directories as needed (limit to wiki root) 120 * [ ] Wishlist: some sort of shortcut (with pattern matching) to add 121 links to existing wiki pages 122 * [ ] Wishlist: checklist shortcuts (check/uncheck [ ] boxes) 123 124 125 ## License 126 127 MIT License 128 129 Copyright (c) 2020 Dave Gauer 130 131 Permission is hereby granted, free of charge, to any person obtaining a copy 132 of this software and associated documentation files (the "Software"), to deal 133 in the Software without restriction, including without limitation the rights 134 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 135 copies of the Software, and to permit persons to whom the Software is 136 furnished to do so, subject to the following conditions: 137 138 The above copyright notice and this permission notice shall be included in all 139 copies or substantial portions of the Software. 140 141 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 142 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 143 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 144 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 145 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 146 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 147 SOFTWARE.