Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajorgensen/vim-markdown-toc
An easy way to generate a table of contents for your markdown file
https://github.com/ajorgensen/vim-markdown-toc
Last synced: 3 months ago
JSON representation
An easy way to generate a table of contents for your markdown file
- Host: GitHub
- URL: https://github.com/ajorgensen/vim-markdown-toc
- Owner: ajorgensen
- License: mit
- Created: 2015-06-02T15:42:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T17:32:22.000Z (over 3 years ago)
- Last Synced: 2024-05-13T22:37:54.180Z (6 months ago)
- Language: Vim script
- Size: 5.86 KB
- Stars: 23
- Watchers: 4
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- writingvim - vim-markdown-toc
README
# 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.
1. [Usage](#usage)
2. [Configuration](#configuration)
3. [Example](#example)
4. [Installation](#installation)## Usage
* Run `:GenerateMarkdownTOC` to 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## 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`
```vimscript
let g:mdtoc_starting_header_level = 1
```## Example
```markdown
# Top level header1. [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 hereAnother 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 inception
```## Installation
You can use your favorite vim package manage but here are a few for your convenience.
```vimscript
" plug.vim
Plug 'ajorgensen/vim-markdown-toc'" Vundle
Plugin 'ajorgensen/vim-markdown-toc'
```