Skip to content

Integrations

shortcuts edited this page Sep 26, 2026 · 1 revision

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.

neo-tree with no-neck-pain.nvim

Supported plugins

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:

  • left or right: 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.

Move a tree to the other side

Set position to match the side your tree plugin opens on:

require("no-neck-pain").setup({
    integrations = {
        NvimTree = { position = "right" },
    },
})

Add a plugin that is not in the list

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.

How the width is computed

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.

Dashboards

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.