All Projects → mzlogin → Vim Markdown Toc

mzlogin / Vim Markdown Toc

Licence: mit
A vim 7.4+ plugin to generate table of contents for Markdown files.

Projects that are alternatives of or similar to Vim Markdown Toc

filestyle
filestyle is a Vim plugin that highlights unwanted whitespace and characters.
Stars: ✭ 30 (-92.97%)
Mutual labels:  vim-plugin, vim-plugins
vim-tmuxlike
A vim plugin that mimics the actions of tmux. 像操作Tmux一样操作Vim
Stars: ✭ 20 (-95.32%)
Mutual labels:  vim-plugin, vim-plugins
vim-inccomplete
Vim plugin for #include directive completion.
Stars: ✭ 14 (-96.72%)
Mutual labels:  vim-plugin, vim-plugins
vim-phpstan
A Vim plugin for PHPStan - https://github.com/phpstan/phpstan. It calls `phpstan` to do static analysis of your PHP code and displays the errors in Vim's quickfix list.
Stars: ✭ 26 (-93.91%)
Mutual labels:  vim-plugin, vim-plugins
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+714.52%)
Mutual labels:  toc, markdown
vim-jsonc
⚠️Deprecated⚠️: Vim syntax highlighting plugin for JSON with C-style line (//) and block (/* */) comments.
Stars: ✭ 52 (-87.82%)
Mutual labels:  vim-plugin, vim-plugins
vim-bettergrep
A better way to grep in vim.
Stars: ✭ 15 (-96.49%)
Mutual labels:  vim-plugin, vim-plugins
Markdown Toc
🎄Generate toc for github markdown file.(为 markdown 文件生成 toc 目录)
Stars: ✭ 144 (-66.28%)
Mutual labels:  toc, markdown
vim-hugo-helper
A small Vim plugin with a set of helpers for Hugo https://gohugo.io
Stars: ✭ 82 (-80.8%)
Mutual labels:  vim-plugin, vim-plugins
bufstop
Fast and efficient buffer switching for Vim
Stars: ✭ 82 (-80.8%)
Mutual labels:  vim-plugin, vim-plugins
vim-sass-colors
sass/scss/less/css color literal and color variable highlighting (works with imports)
Stars: ✭ 24 (-94.38%)
Mutual labels:  vim-plugin, vim-plugins
Pear Tree
A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
Stars: ✭ 327 (-23.42%)
Mutual labels:  vim-plugin, vim-plugins
Github Markdown Toc
Easy TOC creation for GitHub README.md
Stars: ✭ 2,734 (+540.28%)
Mutual labels:  toc, markdown
swifty-vim
⌨️ A Vim plugin for Swift which provides file detection, syntax highlighting, support for compiling and running tests, and optional support for formatting and linting tools.
Stars: ✭ 18 (-95.78%)
Mutual labels:  vim-plugin, vim-plugins
Remark Toc
plugin to generate a Table of Contents (TOC)
Stars: ✭ 165 (-61.36%)
Mutual labels:  toc, markdown
VimConfig
Configuration files for Vi-IMproved.
Stars: ✭ 23 (-94.61%)
Mutual labels:  vim-plugin, vim-plugins
Markdown Toc
Generate a markdown TOC (table of contents) for a README or any markdown files, using remarkable. Used by assemble, verb, and lots of other projects on GitHub. API and CLI.
Stars: ✭ 1,185 (+177.52%)
Mutual labels:  toc, markdown
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+2649.65%)
Mutual labels:  toc, markdown
vim-js-file-import
Import/require files in javascript and typescript with single button!
Stars: ✭ 130 (-69.56%)
Mutual labels:  vim-plugin, vim-plugins
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-24.12%)
Mutual labels:  markdown, vim-plugin

vim-markdown-toc

A vim 7.4+ plugin to generate table of contents for Markdown files.

中文版使用指南

Table of Contents

Features

  • Generate table of contents for Markdown files.

    Supported Markdown parsers:

    • [x] GFM (GitHub Flavored Markdown)
    • [x] GitLab
    • [x] Redcarpet
  • Update existing table of contents.

  • Auto update existing table of contents on save.

Installation

Suggest to manage your vim plugins via Vundle so you can install it simply three steps:

  1. add the following line to your vimrc file

    Plugin 'mzlogin/vim-markdown-toc'
    
  2. :so $MYVIMRC

  3. :PluginInstall

Installation with vim-plug is likeness.

Usage

Generate table of contents

Move the cursor to the line you want to append table of contents, then type a command below suit you. The command will generate headings after the cursor into table of contents.

  1. :GenTocGFM

    Generate table of contents in GFM link style.

    This command is suitable for Markdown files in GitHub repositories, like README.md, and Markdown files for GitBook.

  2. :GenTocRedcarpet

    Generate table of contents in Redcarpet link style.

    This command is suitable for Jekyll or anywhere else use Redcarpet as its Markdown parser.

  3. :GenTocGitLab

    Generate table of contents in GitLab link style.

    This command is suitable for GitLab repository and wiki.

  4. :GenTocMarked

    Generate table of contents for iamcco/markdown-preview.vim which use Marked markdown parser.

You can view here to know differences between GFM and Redcarpet style toc links.

Update existing table of contents

Generally you don't need to do this manually, existing table of contents will auto update on save 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.

Remove table of contents

:RemoveToc command will do this for you, just remember keep insert fence option by default.

Options

  1. g:vmt_auto_update_on_save

    default: 1

    This plugin will update existing table of contents on save automatic.

    You can close this feature by add the following line to your vimrc file:

    let g:vmt_auto_update_on_save = 0
    
  2. g:vmt_dont_insert_fence

    default: 0

    By default, the :GenTocXXX commands will add <!-- vim-markdown-toc --> 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.

    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
    

    But then you will lose the convenience of auto update tables of contents on save and :UpdateToc command. When you want to update toc, you need to remove existing toc manually and rerun :GenTocXXX commands.

  3. g:vmt_fence_text

    default: vim-markdown-toc

    Inner text of the fence marker for the table of contents, see g:vmt_dont_insert_fence.

  4. g:vmt_fence_closing_text

    default: g:vmt_fence_text

    Inner text of the closing fence marker. E.g., you could let g:vmt_fence_text = 'TOC' and let g:vmt_fence_closing_text = '/TOC' to get

    <!-- TOC -->
    [TOC]
    <!-- /TOC -->
    
  5. g:vmt_fence_hidden_markdown_style

    default: ''

    By default, vim-markdown-toc will add the markdown style into the fence of the text for the table of contents. 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. Obviously, g:vmt_fence_hidden_markdown_style has to be supported, i.e. currently one of ['GFM', 'Redcarpet', 'GitLab', 'Marked'].

  6. g:vmt_cycle_list_item_markers

    default: 0

    By default, * is used to denote every level of a list:

    * [Level 1](#level-1)
        * [Level 1-1](#level-1-1)
        * [Level 1-2](#level-1-2)
            * [Level 1-2-1](#level-1-2-1)
    * [Level 2](level-2)
    

    If you set:

    let g:vmt_cycle_list_item_markers = 1
    

    every level will instead cycle between the valid list item markers *, - and +:

    * [Level 1](#level-1)
        - [Level 1-1](#level-1-1)
        - [Level 1-2](#level-1-2)
            + [Level 1-2-1](#level-1-2-1)
    * [Level 2](level-2)
    

    This renders the same according to Markdown rules, but might appeal to those who care about readability of the source.

  7. g:vmt_list_item_char

    default: *

    The list item marker, it can be *, - or +.

  8. g:vmt_include_headings_before

    default: 0

    Include headings before the position you are inserting Table of Contents.

Screenshots

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].