Coder Social home page Coder Social logo

yifili09 / vim-markdown-toc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mzlogin/vim-markdown-toc

0.0 1.0 0.0 926 KB

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

Home Page: http://www.vim.org/scripts/script.php?script_id=5460

License: MIT License

Vim Script 100.00%

vim-markdown-toc's Introduction

vim-markdown-toc

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

中文版使用指南

Table of Contents

Features

  • Generate table of contents for Markdown files.

    Supported Markdown parsers:

    • GFM (GitHub Flavored Markdown)
    • 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.

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

Update existing table of contents manually

Generally you don't need to do this, existing table of contents will auto update on save by default. If you want do it manually, just use :UpdateToc command.

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, 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 contens on save.

Screenshots

References

vim-markdown-toc's People

Contributors

mzlogin avatar

Watchers

Yifei Li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.