

This renders the same according to Markdown rules, but might appeal to those who care about readability of the source. If you set: let g:vmt_cycle_list_item_markers = 1Įvery level will instead cycle between the valid list item markers *, - and +: * (#level-1) īy default, * is used to denote every level of a list: * (#level-1) Obviously, g:vmt_fence_hidden_markdown_style has to be supported, i.e. You can avoid this and set a default markdown style with g:vmt_fence_hidden_markdown_style that is applied if a fence is found containing the g:vmt_fence_text without any markdown style. E.g., you could let g:vmt_fence_text = 'TOC' and let g:vmt_fence_closing_text = '/TOC' to get īy default, vim-markdown-toc will add the markdown style into the fence of the text for the table of contents. Inner text of the fence marker for the table of contents, see g:vmt_dont_insert_fence.

#Macdown vim plugin update#
When you want to update toc, you need to remove existing toc manually and rerun :GenTocXXX commands. If you don't like this, you can remove the fence by add the following line to your vimrc file: let g:vmt_dont_insert_fence = 1īut then you will lose the convenience of auto update tables of contents on save and :UpdateToc command. You can close this feature by add the following line to your vimrc file: let g:vmt_auto_update_on_save = 0īy default, the :GenTocXXX commands will add fence to the table of contents, it is designed for feature of auto update table of contents on save and :UpdateToc command, it won't effect what your Markdown file looks like after parse. This plugin will update existing table of contents on save automatic. :RemoveToc command will do this for you, just remember keep insert fence option by default.

The :UpdateToc command, which is designed to update toc manually, can only work when g:vmt_auto_update_on_save turned off, and keep insert fence. Generally you don't need to do this manually, existing table of contents will auto update on save by default. You can view here to know differences between GFM and Redcarpet style toc links. Generate table of contents for iamcco/markdown-preview.vim which use Marked markdown parser. This command is suitable for GitLab repository and wiki. Generate table of contents in GitLab link style. This command is suitable for Jekyll or anywhere else use Redcarpet as its Markdown parser. Generate table of contents in Redcarpet link style. This command is suitable for Markdown files in GitHub repositories, like README.md, and Markdown files for GitBook. Generate table of contents in GFM link style. The command will generate headings after the cursor into table of contents. Move the cursor to the line you want to append table of contents, then type a command below suit you.
#Macdown vim plugin install#
Suggest to manage your vim plugins via vim-plug or Vundle, so you can install it simply three steps: vim-plugĪdd the following line to your vimrc file Plug 'mzlogin/vim-markdown-toc'Īdd the following line to your vimrc file Plugin 'mzlogin/vim-markdown-toc' Generate table of contents for Markdown files.Īuto update existing table of contents on save. A vim 7.4+ plugin to generate table of contents for Markdown files.
