Note While the plugin generally works, the code is still a work in progress, somewhat rough and may contain bugs. It will take time to fully iron out all edge cases.
- Simple plugin that centers the main buffer.
- Compatible with side buffer plugins (like neo-tree.nvim).
- Automatically toggles side buffers whenever a side buffer is opened/closed without flickering.
- Responsive during resizing.
- Supports tabs, horizontal and vertical splits.
- Layout and positioning options.
- Removes the need for a visual guide showing the maximum line width
(
ColorColumn). - Reduces neck strain and improves focus.
Using Lazy.nvim
return {
"sand4rt/zen.nvim",
lazy = false,
opts = {
main = {
width = 148, -- or vim.wo.colorcolumn
},
-- TIP: find a buffer's filetype with :lua print(vim.bo.filetype)
top = {
{ filetype = "man" },
{ filetype = "help" },
{ filetype = "fugitive" },
},
right = {
min_width = 46,
{ filetype = "copilot-chat" },
{ filetype = "neotest-summary" },
{ filetype = { "dapui_watches", "dapui_scopes", "dapui_stacks", "dapui_breakpoints" } },
},
bottom = {
{ filetype = "dap-repl" },
{ filetype = "qf" },
{ filetype = "trouble" },
{ filetype = "noice" }, -- noice opens large notifications in a buffer
},
left = {
min_width = 46,
{ filetype = "fugitiveblame" },
{ filetype = "fyler" },
{ filetype = "neotree" },
{ filetype = "dbui" },
{ filetype = { "undotree", "diff" } },
},
},
}