Skip to content

ListBullets

MeanderingProgrammer edited this page Dec 7, 2024 · 6 revisions

List Bullets

Raw data being used:

# List

- Nest 0 Item 1
  - Nest 1 Item 1
  - Nest 1 Item 2
    - Nest 2 Item 1
      - Nest 3 Item 1
        - Nest 4 Item 1
- Nest 0 Item 2
  - Nest 1 Item 3

Default

require('render-markdown').setup({
    bullet = {
        enabled = true,
        icons = { '', '', '', '' },
        ordered_icons = function(level, index, value)
            value = vim.trim(value)
            local value_index = tonumber(value:sub(1, #value - 1))
            return string.format('%d.', value_index > 1 and value_index or index)
        end,
        left_pad = 0,
        right_pad = 0,
        highlight = 'RenderMarkdownBullet',
    },
})

Custom Icons

require('render-markdown').setup({
    bullet = { icons = { '', '' } },
})

Nested List

require('render-markdown').setup({
    bullet = { icons = { { '󰫶 ', '󱂉 ' } } },
})

Left Pad

require('render-markdown').setup({
    bullet = { left_pad = 4 },
})

Right Pad

require('render-markdown').setup({
    bullet = { right_pad = 2 },
})
Clone this wiki locally