Skip to content

EtiamNullam/fold-ribbon.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

fold-ribbon.nvim

Takes control over statuscolumn to indicate fold depth at a glance.

Indirectly inspired by Xcode fold indicator.

kevinhwang91/nvim-ufo#24

Installation

lazy.nvim:

{
    'EtiamNullam/fold-ribbon.nvim',
    config = function()
        require('fold-ribbon').setup()
    end,
},

vim-plug:

Plug 'EtiamNullam/fold-ribbon'

Usage

Give full control over statuscolumn

Useful when you do not have the statuscolumn configured or need a simple solution.

require('fold-ribbon').setup()

Get component for use in statuscolumn

Choose this if you are already have a custom statuscolumn and you want to add fold-ribbon to it.

local ribbon = require('fold-ribbon').get_ribbon()

vim.o.statuscolumn = '%l ' .. ribbon

Use custom highlight colors

You can define your own colors at each fold level. If there are more fold levels than amount of defined steps they will loop. highlight_steps has to be a table of highlights just as you would use in vim.api.nvim_set_hl.

require('fold-ribbon').setup {
    highlight_steps = {
        { bg = '#ff8888' },
        { bg = '#88ff88' },
        { bg = '#8888ff' },
    }
}

Disable

You can toggle plugin by passing disable = true as option to setup.

require('fold-ribbon').setup {
    disable = true,
}