-
-
Notifications
You must be signed in to change notification settings - Fork 28
Integrations
File trees, symbol outlines, and debug panels open their own windows next to your code. no-neck-pain.nvim detects them by filetype and makes the side buffer on that side narrower, so the tree and the padding share the space.

| Plugin | Key in integrations
|
Default position
|
|---|---|---|
| nvim-tree.lua | NvimTree |
left |
| neo-tree.nvim | neo-tree |
left |
| undotree | undotree |
left |
| snacks.nvim explorer | snacks_picker |
left |
| outline.nvim | outline |
right |
| aerial.nvim | aerial |
right |
| neotest | neotest |
right |
| nvim-dap-ui | dap |
none |
| oil.nvim | oil |
none |
position tells the plugin which side buffer to shrink:
-
leftorright: the side buffer on that side loses the width of the integration window. -
none: the plugin does not shrink a side buffer for this window. The defaults use it for dap-ui, which opens panels on several sides, and for oil, which opens in the main window.
Set position to match the side your tree plugin opens on:
require("no-neck-pain").setup({
integrations = {
NvimTree = { position = "right" },
},
})The key is the filetype of the plugin's window. Open the plugin, focus its window, and run :set filetype? to get it. Keys are case-insensitive.
require("no-neck-pain").setup({
integrations = {
["my-sidebar"] = { position = "right" },
},
})If the plugin is popular, open a pull request to add it to the defaults.
The plugin subtracts every open integration window from the screen width, then centers the main window in the remaining space. With a 160-column screen, a 30-column tree on the left, and width = 80, each side buffer gets about (160 - 30 - 80) / 2 = 25 columns. The main window is centered between the tree and the right edge, not on the full screen.
A side buffer narrower than minSideBufferWidth (default 10) is not created. If a wide tree leaves no room, lower width, narrow the tree, or lower minSideBufferWidth.
A dashboard opens when Neovim starts. With autocmds.enableOnVimEnter and dashboard.enabled, the plugin waits until you open a regular buffer before it enables itself.
require("no-neck-pain").setup({
autocmds = { enableOnVimEnter = "safe" },
integrations = {
dashboard = {
enabled = true,
-- defaults: dashboard, alpha, starter, snacks
filetypes = { "dashboard", "alpha", "starter", "snacks" },
},
},
})Add the filetype of your dashboard to filetypes if it is not in the defaults.