2

I recently switched from VsCode and I am quite confused about the window/pane system of neovim.

It seems like these are the only options to actually use panes in neovim: https://stackoverflow.com/a/4571319/9168173

But all these options just switch and move the panes itself. I'd like to move the buffer into a new pane instead. Consider this example:

Panes A B C

Files 1 2 3

what if i just want to move File 1 to Pane B?

I consider Panes as stack of files/buffers.

Lets say i've File 1 open on Pane A and open File 4 on top of it. If i move now File 4 to Pane B, i would end up with this:

Panes A B C

Files 1 4 3

since there is still File 1 on the Stack of Pane A. Is this behaviour even possible in vim/neovim?

1

1 Answer 1

2

The "Files" (called buffers in Vim documentation) are not associated to "Panes" (called windows in Vim documentation).

To have buffer 4 to window B you could:

  • Go to window B and
  • Open buffer 4 (:b 4)

To move buffer through windows you could be interested to look at the winresizer plugin that let you move buffer across windows using the h, j, k and l keys.

With the plugin you have to:

  1. Activate winresizer with Ctrl e and
  2. Switch to buffer move mode with e
  3. Use the h, j, k and l keys to move the current buffer across windows.
2
  • Thanks for the answer. At least i know now from a knowledgeable person whats possible and what isn't. Maybe i'll create my own plugins, to enable stack-based window management - i'll see
    – Chikko
    Apr 15, 2023 at 15:24
  • Thanks for the feedback! Welcome to Vim :-) Apr 15, 2023 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.