vim-exchange
vim-exchange copied to clipboard
Request: Swapping text across different buffers
Right now, It appears as though the last area marked for swapping is local to the window, or possibly the buffer. Seems more useful to me to just have one global concept of swapping text.
This would be a pretty easy change. I had chosen to use buffer-local exchanges, but I don't really remember the reasons. Looking at it now, I agree that it would be more useful to be able to set exchanges globally.
I'll whip something up shortly.
I remember the reasons now; not knowing where the buffer is. It could be hidden, or completely deleted. I'll have to think about this more before I implement anything.
In case of a hidden or deleted buffer, it might just abort with an error - just like with overlapping text.
That seems like a sensible thing to do. I'll try it out when I get some available time.
A problem that comes to mind is the use of u
after doing an exchange across two buffers.
I hope it's deemed acceptable that only the active buffer will be reverted; to cite some default Vim behaviour, consider the disappointment that arises when u
follows dp
in diff mode. It's not what the user wanted, but I think meeting the expectations of the user in a situation like this is just beyond reasonable.
Agreed.