sponsor Vim development Vim logo Vim Book Ad

vim9-toc : Unified table of contents for Vim: folds + helptoc delegation

 script karma  Rating 0/0, Downloaded by 4  Comments, bugs, improvements  Vim wiki

created by
Wei Chen
 
script type
utility
 
description
* github: https://github.com/VimWei/vim9-toc

A single :Toc command that gives any buffer an interactive, hierarchical table of contents in a popup window. It delegates to Vim's built-in helptoc for the filetypes helptoc already understands, and derives an outline from Vim's own folding for everything else — so any filetype that ships a folding ftplugin (TOML, YAML, JSON, Git, Vim script, ...) works out of the box.

* Features

- One entry point for all filetypes: :Toc
- Delegates to the built-in helptoc for structured formats (help, markdown, LaTeX, HTML, AsciiDoc, man, ...)
- Fold-driven outline for anything Vim can fold (foldmethod expr / marker / syntax / indent)
- Indentation-based outline as a last resort for buffers without folding
- Extensible per-filetype "collectors" via toc#AddCollector()
- Interactive popup: navigate, jump, and collapse/expand levels
 
install details
* With vim-plug:

```vim
Plug 'VimWei/vim9-toc'
```

* Or with Vim built-in packages:

```sh
mkdir -p ~/.vim/pack/toc/start
cd ~/.vim/pack/toc/start
git clone https://github.com/VimWei/vim9-toc.git
```
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim9-toc-v0.1.0.zip 0.1.0 2026-08-15 9.1 Wei Chen Initial upload
ip used for rating: 216.73.216.240

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github