Skip to content

Commit 5ce8be5

Browse files
committed
Add command to remove toc
1 parent ead7467 commit 5ce8be5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ A vim plugin to generate table of contents for Markdown files.
1212
* [Usage](#usage)
1313
* [Generate table of contents](#generate-table-of-contents)
1414
* [Update existing table of contents](#update-existing-table-of-contents)
15+
* [Remove table of contents](#remove-table-of-contents)
1516
* [Options](#options)
1617
* [Screenshots](#screenshots)
1718
* [References](#references)
@@ -73,6 +74,10 @@ Generally you don't need to do this manually, existing table of contents will au
7374
7475
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.
7576
77+
### Remove table of contents
78+
79+
`:RemoveToc` command will do this for you, just remember keep insert fence option by default.
80+
7681
## Options
7782
7883
1. `g:vmt_auto_update_on_save`

ftplugin/markdown.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ endfunction
316316
command! GenTocGFM :call <SID>GenToc("GFM")
317317
command! GenTocRedcarpet :call <SID>GenToc("Redcarpet")
318318
command! UpdateToc :call <SID>UpdateToc()
319+
command! RemoveToc :call <SID>DeleteExistingToc()
319320

320321
if g:vmt_auto_update_on_save == 1
321322
autocmd BufWritePre *.{md,mdown,mkd,mkdn,markdown,mdwn} :silent! UpdateToc

0 commit comments

Comments
 (0)