My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
TagList4Vimwiki  
TagList support for Vimwiki.
Updated Apr 27, 2010 by HoToo.cn

Introduction

Insert %toc in Vimwiki file(.wiki), and convert it to html, we will have a table of contents in the html document.

and now we use taglist and ctags to show the outline for wiki file.

Installation

Exuberant Ctags:

  1. Download ctags and intall it.
  2. !IMPORTANT need ctags v5.8 +regex support.
  3. Extract ctags.exe to $path for Windows(C:\Windows\system32), use command ctags -version in commandline to test.
  4. or extract to any path and set vimrc:
  5. " for Windows:
    let g:ctags_path='path\to\ctags.exe'

TagList:

  1. Download and extract taglist.vim to $VIM\vimfiles\plugin or ~/.vim/plugin.
  2. vimrc setting:
  3. filetype on
    let g:Tlist_Use_Right_Window=1
    let g:Tlist_WinWidth=25
    " If ctags not in $path, set this.
    "let Tlist_Ctags_Cmd='path\to\ctags.exe'
    nnoremap <F12> :TlistToggle<CR>

Details

$HOME/.ctags setting:

for Windows create $HOME\.ctags or $HOME\ctags.cnf file.

for Linux or Mac: ~/.ctags

--langdef=wiki
--langmap=wiki:.wiki
--regex-wiki=/^=[ \t]+(.+)[ \t]+=$/\1/h,header/
--regex-wiki=/^==[ \t]+(.+)[ \t]+==$/. \1/h,header/
--regex-wiki=/^===[ \t]+(.+)[ \t]+===$/.   \1/h,header/
--regex-wiki=/^====[ \t]+(.+)[ \t]+====$/.     \1/h,header/
--regex-wiki=/^=====[ \t]+(.+)[ \t]+=====$/.       \1/h,header/
--regex-wiki=/^======[ \t]+(.+)[ \t]+======$/.         \1/h,header/

or simply:

--langdef=wiki
--langmap=wiki:.wiki
--regex-wiki=/^(={1,6})[ \t]+(.+)[ \t]+\1$/\2/h,header/

vimrc setting:

let tlist_vimwiki_settings = 'wiki;h:Headers'

Screenshot:

http://www.flickr.com/photos/hotoo/4555003526/

http://www.flickr.com/photos/hotoo/4553944243/

Comment by jeffshaw...@gmail.com, Jan 17, 2011

cool stuff. the ctags toc shows up out-of-box. how do I use the feature of toc in generated html? cannot find it anywhere. thanks

Comment by jeffshaw...@gmail.com, Jan 20, 2011

ok, got it. "You can generate 'Table of contents' of your wiki page. See :h vimwiki-toc for details. "


Sign in to add a comment
Powered by Google Project Hosting