Skip to content

foldcolumn

Zeioth edited this page Feb 24, 2024 · 1 revision

You can add this component to the statuscolumn section of heirline opts.

require("heirline-components.all").component.foldcolumn()

On the left side of the image you can see it displays a fold/unfold icon on the statuscolumn area. screenshot_2024-02-24_01-05-22_687350617

Available providers

These are the available providers for this component and its options.

foldcolumn = { padding = { right = 1 } },
condition = condition.foldcolumn_enabled,
on_click = {
  name = "fold_click",
  callback = function(...)
    local char = core_utils.statuscolumn_clickargs(...).char
    local fillchars = vim.opt_local.fillchars:get()
    if char == (fillchars.foldopen or get_icon "FoldOpened") then
      vim.cmd "norm! zc"
    elseif char == (fillchars.foldclose or get_icon "FoldClosed") then
      vim.cmd "norm! zo"
    end
  end,
},

Clone this wiki locally