Ⅰ. 插件描述
An easy way to generate a table of contents for your markdown fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ajorgensen/vim-markdown-toc-impatience-and-laziness'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ajorgensen/vim-markdown-toc-impatience-and-laziness'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ajorgensen/vim-markdown-toc-impatience-and-laziness'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ajorgensen/vim-markdown-toc
Ⅳ. 文档说明
# markdown-toc.vim
Have you ever wanted to have a sweet table of contents for your markdown file but didn't want to deal with the pain of generating it yourself? Well now you dont have to.
Usage
Run
:GenerateMarkdownTOCto generate the table of contents for an open markdown file. This will place the generated table of contents at the location of your cursor at the time that you run the command.- Supports both
#and==/--styles of header declarations
- Supports both
Configuration
By default this plugin will not generate an entry for top level headers (# or ==). You can modifying this behavior by setting g:mdtoc_starting_header_level = 1
let g:mdtoc_starting_header_level = 1Example
# Top level header
1. [Sub-heading](#sub-heading)
2. [Another sub heading](#another-sub-heading)
1. [You can even mix heading styles if that floats your boat](#you-can-even-mix-heading-styles-if-that-floats-your-boat)
1. [This is totally like inception](#this-is-totally-like-inception)
## Sub-heading
Some content will go here
Another sub heading
------------------
Some other content can go here if you want
### You can even mix heading styles if that floats your boat
Because we know you do what you want
#### This is totally like inceptionInstallation
You can use your favorite vim package manage but here are a few for your convenience.
" plug.vim
Plug 'ajorgensen/vim-markdown-toc'
" Vundle
Plugin 'ajorgensen/vim-markdown-toc'