Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Paste window, not swap. #4

Open
trusktr opened this issue Nov 14, 2014 · 5 comments
Open

Request: Paste window, not swap. #4

trusktr opened this issue Nov 14, 2014 · 5 comments

Comments

@trusktr
Copy link

trusktr commented Nov 14, 2014

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.

@wesQ3
Copy link
Owner

wesQ3 commented Nov 18, 2014

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?

@trusktr
Copy link
Author

trusktr commented Nov 20, 2014

@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?

@rosshadden
Copy link

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.

@wesQ3
Copy link
Owner

wesQ3 commented Apr 7, 2015

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.

@firedev
Copy link

firedev commented Feb 3, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants