This plugin for neovim allows you to see fold depth at a glance.
You can let fold-ribbon
take control over statuscolumn
or use the API if you already use custom statuscolumn
(not to be confused with statusline
).
Indirectly inspired by Xcode fold indicator.
neovim
>=0.10
lazy.nvim
:
{
'EtiamNullam/fold-ribbon.nvim',
config = function()
require('fold-ribbon').setup()
end,
},
vim-plug
:
Plug 'EtiamNullam/fold-ribbon'
Useful when you do not have the statuscolumn
configured or need a simple solution.
require('fold-ribbon').setup()
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
Here are all available configuration options with their defaults:
require('fold-ribbon').setup {
disable = false, -- Toggle to disable the plugin after it was started.
align_line_number_right = true, -- Align line numbers to the right, as it is by default.
excluded_filetype_patterns = { -- List of filetype regex patterns where plugin will not be displayed.
'startify',
'help',
},
excluded_path_patterns = {}, -- List of path regex patterns where plugin will not be displayed.
highlight_steps = { -- Defines colors at each fold level.
-- If there are more fold levels than steps defined they will loop.
-- It has to be a table of highlights just as you would use in `vim.api.nvim_set_hl`.
{
fg = '#000000',
bg = '#eeeeee',
},
{
fg = '#000000',
bg = '#dddddd',
},
{
fg = '#000000',
bg = '#cccccc',
},
{
fg = '#000000',
bg = '#bbbbbb',
},
{
fg = '#000000',
bg = '#aaaaaa',
},
{
fg = '#ffffff',
bg = '#999999',
},
{
fg = '#ffffff',
bg = '#888888',
},
{
fg = '#ffffff',
bg = '#777777',
},
{
fg = '#ffffff',
bg = '#666666',
},
{
fg = '#ffffff',
bg = '#555555',
},
{
fg = '#ffffff',
bg = '#444444',
},
{
fg = '#ffffff',
bg = '#333333',
},
{
fg = '#ffffff',
bg = '#222222',
},
{
fg = '#ffffff',
bg = '#111111',
},
{
fg = '#ffffff',
bg = '#000000',
},
},
}
Simple example how to override highlight_steps
:
require('fold-ribbon').setup {
highlight_steps = {
{ bg = '#ff8888' },
{ bg = '#88ff88' },
{ bg = '#8888ff' },
}
}