titleLevelRegExpMatch and titleLevelRegExpReplace : regexp to check title level, result should be any string, whose (length - 1) indicates the title's level
titleNameRegExpMatch and titleNameRegExpReplace : optional, regexp to convert title name to human readable one, empty to use the original matched line
codeBlockBegin and codeBlockEnd : optional, regexp to match code block, any contents inside the code block won't be considered as title, empty to disable this feature
about pattern regexp:
we use othree/eregex.vim for regexp, instead of vim's builtin regexp
additional settings
the TOC preview is a location list in fact (:h :lopen)
you may have these settings in your vimrc to make it more convenient:
ZFVimToc
vim script to quick view TOC (Table Of Contents) for any filetype
if you like my work, check here for a list of my vim plugins
how to use
use Vundle or any other plugin manager you like to install
use
<leader>vt
or:ZFToc
to view a TOCfiletype
(seeg:ZFVimToc_setting
), TOC should show directlyfiletype
, you would be asked to enter regexp to search for titleskeymaps
recommended keymap:
by default, the above keymaps would be applied to
markdown
files, you may disable or change by:config your own filetype
by default, only
markdown
file are configured for TOC view, you may add config for your own filetypepatterns:
titleRegExp
: regexp to match titletitleLevelRegExpMatch
andtitleLevelRegExpReplace
: regexp to check title level, result should be any string, whose (length - 1) indicates the title's leveltitleNameRegExpMatch
andtitleNameRegExpReplace
: optional, regexp to convert title name to human readable one, empty to use the original matched linecodeBlockBegin
andcodeBlockEnd
: optional, regexp to match code block, any contents inside the code block won't be considered as title, empty to disable this featureabout pattern regexp:
additional settings
the TOC preview is a location list in fact (
:h :lopen
)you may have these settings in your vimrc to make it more convenient: