vim-windowswap icon indicating copy to clipboard operation
vim-windowswap copied to clipboard

Request: Paste window, not swap.

Open trusktr opened this issue 9 years ago • 5 comments

Using yw then yp behave like using ww two times: it swaps the windows. It'd be nice to just paste a window, not swap. E.g., I was expecting yw to copy a window, then pw to paste into the chosen buffer while leaving the same buffer in the previous window. e.g. the buffer where pw is called would replace that buffer with the yw buffer, but nothing would happen to the yw buffer.

That would seem to be more intuitive since normal yy followed by a Vp doesn't swap two lines.

trusktr avatar Nov 14 '14 22:11 trusktr

Originally, the binding was mw to "mark" the window for swapping. I changed it to "yank" window because it seemed more vim-like and I thought it would be more familiar to new users. That binding is really kind of vestigial at this point. Really using the easymode ww binding is all you need to do normal swapping; it's what I recommend for common usage.

I see your point about the possibly unexpected behavior of the pw swap but I'm loathe to change it because users are likely depending on it at this point. If a new function was added to let you "clone" a buffer into another window, would that be useful?

wesQ3 avatar Nov 18 '14 20:11 wesQ3

@wesQ3 Yeah, that would be. I agree, I don't use yw or pw because ww is just so much easier.

A clone would definitely be nice, sure. :D I tend to use split windows a ton inside tabs (e.g. 19 windows in my current tab) and sometimes the need arrises. What I've been doing often is :echo bufnr('') in the first window, then :b N in the target window. Idea: ww or yw to initiate like normal, then cw to clone instead of swap? Basically end with pw to swap, or cw to clone?

trusktr avatar Nov 20 '14 07:11 trusktr

I like the idea of cloning. I was confused why "yank" and "put" weren't doing that, and it wasn't until I read the docs that I saw it wasn't really "yank" and "put", despite the function names and mappings.

If this is implemented, I propose using it as a time to switch the function names, if not the bindings as well. Even though it might disrupt people that use them, y makes more sense to "yank" than to "mark", and p makes more sense to "put" than to "move". As long as you keep the option to disable your default mappings this isn't really a big deal, just confusing.

rosshadden avatar Apr 04 '15 17:04 rosshadden

Okay, as a first step I think deprecating the old default mappings is probably best to avoid confusing new users; then this paste/clone window feature can exist on its own.

wesQ3 avatar Apr 07 '15 05:04 wesQ3

Pasting terminal windows in neovim would be great. Are there other similar plugins?

firedev avatar Feb 03 '16 02:02 firedev