Skip to content

Concealer

github-actions[bot] edited this page Jun 25, 2022 · 207 revisions

Concealer Module for Neorg

Enhances the basic Neorg experience by using icons instead of text.

Overview

This module handles the iconification and concealing of several different syntax elements in your document.

It's also directly responsible for displaying completion levels in situations like this:

* Do Some Things
- [ ] Thing A
- [ ] Thing B

Where it will display this instead:

* Do Some Things (0 of 2) [0% complete]
- [ ] Thing A
- [ ] Thing B

Once anticonceal (https://github.com/neovim/neovim/pull/9496) is a thing, punctuation can be added (without removing the whitespace between the icon and actual text) like so:

icon = module.private.ordered_concealing.punctuation.dot(
    module.private.ordered_concealing.icon_renderer.numeric
)

Note: this will produce icons like 1., 2., etc.

You can even chain multiple punctuation wrappers like so:

icon = module.private.ordered_concealing.punctuation.parenthesis(
    module.private.ordered_concealing.punctuation.dot(
        module.private.ordered_concealing.icon_renderer.numeric
    )
)

Note: this will produce icons like 1.), 2.), etc.

Usage

How to Apply

  • To manually load the module, place this code in your Neorg setup:
    ["core.norg.concealer"] = {
       config = { -- Note that this table is optional and doesn't need to be provided
           -- Configuration here
       }
    }
    Consult the configuration section to see how you can configure core.norg.concealer to your liking.

Configuration

icon_preset : Which icon preset to use Go to imports to see which ones are currently defined E.g core.norg.concealer.preset_diamond will be preset = "diamond"

Default value: "basic"

icons : Configuration for icons: their looks and behaviours are contained here

Default Value:

dim_code_blocks : If you want to dim code blocks

Default value: true

Developer Usage

Public API

This segment will detail all of the functions core.norg.concealer exposes. All of these functions reside in the public table.

  • _set_extmark
  • toggle_concealer
  • trigger_icons
  • foldtext
  • trigger_code_block_highlights
  • get_old_extmarks

Examples

None Provided

Extra Info

Version

This module supports at least version 0.0.11. The current Neorg version is 0.0.11.

Imports

Requires

Required by

This module isn't required by any other module.