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
458 stars 12 forks source link

next: feature requests #361

Open shortcuts opened 1 month ago

shortcuts commented 1 month ago

this issue lists the highlighted improvements and bug fixes for the next major version, the goal is to have 0 breaking changes.

custom integrations (external)

plugins that open windows on the side of the screen should not require a specific implementation but rather users should be able to define them based on a defined contract in the config directly

config = {
  -- ...
  integrations = {
    [custom] = {
      position = "left" | "right",
      -- when `openCommand` is defined, we reopen the integration if we closed it
      openCommand = "fooToggle" | nil,
      closeCommand = "fooToggle"
    }
  }
}

might close https://github.com/shortcuts/no-neck-pain.nvim/issues/297

less autocmd events (internal)

there's a lot of logic around autocmd in order to skip certain even in specific scenarios (e.g. WinClosed for integrations, WinClosed for quit, WinClosed for splits), which can make it harder to contribute when you don't know the project, and might cause performance issues even if unnoticeable

leverage winlayout (internal)

i did not knew about winlayout and basically implemented a way to determine if a window is a split or not based on width/height computation, while it seems super reliable it would be much easier to leverage the native solution, and also less complicated to maintain

might close https://github.com/shortcuts/no-neck-pain.nvim/issues/340, https://github.com/shortcuts/no-neck-pain.nvim/issues/298

center on code length (external)

see https://github.com/shortcuts/no-neck-pain.nvim/issues/259 for details and expected behavior

remove deprecated options (external)

some options of the 0 version are still available via aliases, we can use the v1 format

handle session managers (external)

session manager saves the active buffer, the plugin should then be able to either provide a custom autocmd in order to close buffers before leaving vim, or to be able to identify already-existing nnp buffers

might close https://github.com/shortcuts/no-neck-pain.nvim/issues/240, https://github.com/shortcuts/no-neck-pain.nvim/issues/221, https://github.com/shortcuts/no-neck-pain.nvim/issues/111

correct log levels (internal)

see :h vim.log.levels instead of the standard debug logic

snake over camel case (internal)

I've created this plugin without knowing the convention of the neovim plugins/internal docs etc. switching cases is a pain so it's time to migrate


if anyone comes by and have suggestion, please comment :)

shortcuts commented 1 month ago

fix multi tab disable

on disable, prevent quitting nvim if an other tab is active

vinoff commented 1 month ago

I would like to have :q never close NNP, which I think is a sane default. Basically this issue: https://github.com/shortcuts/no-neck-pain.nvim/issues/348

shortcuts commented 1 month ago

I would like to have :q never close NNP, which I think is a sane default. Basically this issue: https://github.com/shortcuts/no-neck-pain.nvim/issues/348

Thanks for your suggestion @vinoff, I can't make it a default as it changes how nvim behaves natively but I'd be happily make it an opt-in option!

Do you expect NNP to re-create a window in that case? If there's none to redirect the focus too

vinoff commented 1 month ago

I would like to have :q never close NNP, which I think is a sane default. Basically this issue: #348

Thanks for your suggestion @vinoff, I can't make it a default as it changes how nvim behaves natively but I'd be happily make it an opt-in option!

Do you expect NNP to re-create a window in that case? If there's none to redirect the focus too

I think you are misunderstanding the issue @shortcuts. This is how other plugins work, for example neo-tree. I just tested it.

With Neo-tree:

With NNP:

What it should do instead is give a warning, just like Neo-tree does. It should never close the NNP window since it is not focused. If one wants to close the NNP window, one has many ways to do that. Just running :NNP is one, or just creating a keybind. Or just moving focus to the NNP window and doing :q. Now, closing a window with :q while another window is being focused is just bad UX, imo.

shortcuts commented 4 weeks ago

default enableOnTabEnter when enableOnVimEnter is true (external)

the behavior is fairly similar, but unless specified in the config directly, defaulting makes it more natural if the user has decided to automatically enable nnp

shortcuts commented 4 weeks ago

make config an object like state (internal)

we globally store the config while it can be an in memory variable like the state in order to properly access it