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


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.


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'


  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>


$HOME/.ctags setting:

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

for Linux or Mac: ~/.ctags

--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:

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

vimrc setting:

let tlist_vimwiki_settings = 'wiki;h:Headers'


Comment by, 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, 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