Skip to content
github-actions[bot] edited this page May 17, 2024 · 36 revisions

core.qol.toc

A Bird's Eye View of Norg Documents

The TOC module geneates a table of contents for a given Norg buffer.

Overview

The TOC module exposes a single command - :Neorg toc. This command can be executed with one of three optional arguments: left, right and qflist.

When left or right is supplied, the Table of Contents split is placed on that side of the screen. When the qflist argument is provided, the whole table of contents is sent to the Neovim quickfix list, should that be more convenient for you.

When in the TOC view, <CR> can be pressed on any of the entries to move to that location in the respective Norg document. The TOC view updates automatically when switching buffers.

Configuration

  • close_after_use
    (boolean)

    If true, will close the Table of Contents after an entry in the table is picked.

    false
  • fit_width
    (boolean)

    If true, the width of the Table of Contents window will automatically fit its longest line

    true
  • sync_cursorline
    (boolean)

    If true, cursurline will be enabled (highlighted) in the ToC window, and the cursor position between ToC and content window will be synchronized.

    true

Dependencies

  • core.integrations.treesitter - A module designed to integrate Treesitter into Neorg.
  • core.ui - A set of public functions to help developers create and manage UI (selection popups, prompts...) in their modules.