Skip to content

Showcase

Clément Vannicatte edited this page Aug 14, 2023 · 12 revisions

Default configuration with split/vsplit showcase

Preview


Side buffers options

Single side padding

Left padding only

require("no-neck-pain").setup({
    buffers = {
        right = {
            enabled = false,
	},
    },
})
Screenshot 2022-12-28 at 18 49 49

GIF demo

Right padding only

require("no-neck-pain").setup({
    buffers = {
        left = {
            enabled = false,
	},
    },
})
Screenshot 2022-12-28 at 18 53 50

GIF demo


Side buffer as scratch pad

💡 The plugin provides a built-in way to leverage the buffers as scratch pads, with auto-saving features!

Snippet

require("no-neck-pain").setup({
    buffers = {
        scratchPad = {
            -- set to `false` to
            -- disable auto-saving
            enabled = true,
            -- set to `nil` to default 
            -- to current working directory
            location = "~/Documents/",
        },
        bo = {
            filetype = "md"
        },
    },
})
Screenshot 2023-01-14 at 22 47 26

Hide end of buffers (eob) characters in side buffers

💡 The plugin doesn't override default theme options, so it's intentional to see eob characters (nvim defaults to ~) if it's enabled in your current theme.

Snippet

require("no-neck-pain").setup({
    buffers = {
        wo = {
            fillchars = "eob: ",
        },
    },
})
Screenshot 2023-01-14 at 22 47 26

Custom background color

💡 The backgroundColor option accepts hexadecimal color codes starting with a #, but also popular theme names, you can find an exhaustive list on the README or in Neovim :h NoNeckPain.bufferOptions. Want to add your theme to the list? open an issue

Common to both buffers

require("no-neck-pain").setup({
    buffers = {
        backgroundColor = "catppuccin-frappe",
    },
})
Screenshot 2022-12-28 at 19 02 18

Scoped to each buffer

require("no-neck-pain").setup({
    buffers = {
        left = {
            backgroundColor = "catppuccin-frappe",
	},
        right = {
	    backgroundColor = "tokyonight-moon",
        }
    },
})
Screenshot 2022-12-28 at 19 08 17

Blend background color

💡 If a backgroundColor is not provided, we will blend the background color of your current theme.

Darken

require("no-neck-pain").setup({
    buffers = {
        blend = -0.2,
    },
})
Screenshot 2022-12-28 at 22 41 25

Brighten

require("no-neck-pain").setup({
    buffers = {
        blend = 0.3,
    },
})
Screenshot 2022-12-28 at 22 42 26

Window layout support

Split

Side buffers are left in place when opening a split or help window

snippet used for the screenshot

require("no-neck-pain").setup({
    width = 80,
    buffers = {
        backgroundColor = "onedark",
        blend = -0.1,
        scratchPad = {
            enabled = true,
            fileName = "notes",
            location = "~/",
        },
        bo = {
            filetype = "md",
        },
    },
})
Screenshot 2023-01-29 at 17 02 49

Vertical split

💡 If there's enough space, side buffers are resized after opening a vsplit, otherwise, they are killed and automatically reopened when possible.

snippet used for the screenshot

require("no-neck-pain").setup({
    width = 80,
    buffers = {
        backgroundColor = "onedark",
        blend = -0.1,
        scratchPad = {
            enabled = true,
            fileName = "notes",
            location = "~/",
        },
        bo = {
            filetype = "md",
        },
    },
})
Screenshot 2023-01-29 at 17 05 41

Resize / small window

Works out of the box when resizing your terminal, opening tmux panes, having multiple small windows, etc.

Screenshot 2022-12-28 at 19 15 09

GIF demo