fringe-mode.nvim is a simple nvim plugin to add margin (fringe) to the left and right of your buffers.
TODO: Add a video here to show fringe-mode.nvim in action.
- Adds fringe (margin) to left and right of main windows
- Toggle on and off
- Fringe windows can't be navigated to from other windows
- Recreate fringe windows if they get closed, but mode is active
- Ability to set bg color for fringe windows and a few other options
- Ability to balance out fringe window widths after resizing othe windows
{
'kronning6/fringe-mode.nvim',
config = function()
require('fringe-mode').setup({
-- options (see below)
})
end,
},Defaults:
{
balance_windows = false, -- Optionally call ctrl-w = before sizing fringe windows
bgcolor = nil, -- Set the background color for the fringe windows
min_fringe_window_width = 10, -- If fringe window is less than 10 cols, use narrow widths
widths = { -- Add 8 cols to account for git signs and line numbers
normal = 128, -- More modern max code width
narrow = 88, -- Standard max code width
}
}- Works alright with nvim-tree (and likely other nav trees) but may be a little buggy
- Unknown
- Keep track of win_ids and widths of fringe windows and row=1 windows
- On window close (e.g. ctrl-w o, ctrl-w c), resize windows
- Resize fringe windows on resize of other windows
- Improved window width calculations
- Capture window widths before resizes to keep proportions
- Uses
vim.o.columnsand window widths to calculate fringe widths - For horizontal splits, windows other than row=1 windows will also need to be tracked
- Uses
- Responsive when zooming in and out
- Capture window widths before resizes to keep proportions
- Add configurable options
- Balance windows on mode activation or maintain width proportions
- Add option to override ctrl-w o to provide a better UX that doesn't flicker
- Remove border and padding between windows (visible when fringe window bg color is changed)