How can I swap positions of two open files (in splits) in vim?
Assume I've got some arbitrary layout of splits in vim.
____________________
| one | two |
| | |
| |______|
| | three|
| | |
|___________|______|
Is there a way to swap one
and two
and maintain the same layout? It's simple in this example, but I'm looking for a solution that will help for more complex layouts.
UPDATE:
I guess I should be more clear. My previous example was a simplification of the actual use-case. With an actual instance:
How could I swap any two of those splits, maintaining the same layout?
Update! 3+ years later...
I put sgriffin's solution in a Vim plugin you can install with ease! Install it with your favorite plugin manager and give it a try: WindowSwap.vim