Skip to content

Checkboxes

MeanderingProgrammer edited this page Aug 20, 2024 · 5 revisions

Checkboxes

Raw data being used:

# Checkboxes

- [ ] Unchecked
- [x] Checked
- [-] Todo
- [~] Custom

Default

require('render-markdown').setup({
    checkbox = {
        enabled = true,
        position = 'inline',
        unchecked = {
            icon = '󰄱 ',
            highlight = 'RenderMarkdownUnchecked',
        },
        checked = {
            icon = '󰱒 ',
            highlight = 'RenderMarkdownChecked',
        },
        custom = {
            todo = { raw = '[-]', rendered = '󰥔 ', highlight = 'RenderMarkdownTodo' },
        },
    },
})

Custom Icons

require('render-markdown').setup({
    checkbox = {
        unchecked = { icon = '' },
        checked = { icon = '' },
        custom = { todo = { rendered = '' } },
    },
})

Custom State

require('render-markdown').setup({
    checkbox = {
        custom = {
            important = { raw = '[~]', rendered = '󰓎 ', highlight = 'DiagnosticWarn' },
        },
    },
})

Position Overlay

require('render-markdown').setup({
    checkbox = {
        position = 'overlay',
    },
})
Clone this wiki locally