shortcuts / no-neck-pain.nvim

☕ Dead simple yet super extensible plugin to center the currently focused buffer to the middle of the screen.
MIT License
552 stars 13 forks source link

feat(scratchPad): provide `pathToFile` option #332

Closed shortcuts closed 6 months ago

shortcuts commented 6 months ago

📃 Summary

It's hard to compose a scratchpad file location today, it requires 3 props to determine the full pathToFile and the custom filetype doesn't work everytime.

The idea is to propose a single property that does it all, which will deprecate all the other options in the next major

before, in order to define custom buffers

buffers = {
    left = {
        bo = {
            filetype = "custom"
        },
        scratchPad = {
            enabled = true,
            fileName = "notes",
            location = "~/Documents"
        },
    },
    right = {
        bo = {
            filetype = "md"
        },
        scratchPad = {
            enabled = true,
            fileName = "foo",
            location = "./bar/baz"
        },
    },
},

now

buffers = {
    left = {
        bo = {
            filetype = "custom"
        },
        scratchPad = {
            enabled = true,
            pathToFile = "~/Documents/notes.custom"
        },
    },
    right = {
        scratchPad = {
            enabled = true,
            pathToFile = "./bar/baz/foo.md"
        },
    },
},