4 ms·
I was referring to the commands to manipulate complex layouts. Take the following transformation for example: +---+---+---+ +---+---+ | | 1 |
by xiaq 12y ago
I was referring to the commands to manipulate complex layouts. Take the following transformation for example:
+---+---+---+ +---+---+
| | 1 | | | 0 | 1 |
| 0 +---+ 3 | => |---+---+
| | 2 | | | 3 | 2 |
+---+---+---+ +---+---+
The tmux command to achieve this is "move-pane -s .3 -t .0 -v", which reads very natural once you know the options. "Move the source pane 3 to the target pane 0 by creating a vertical split in the target pane".
I then looked up windows.txt of the vim reference manual. In the window-moving section, we are given commands to rotate and exchange windows and move windows to the far left, right, top and bottom. So apparently I can achieve my goal by moving 3 to the far left, splitting 0 into 0a and 0b, exchanging 3 with 0a, and closing 0a. Which is why I always end up closing 3, splitting 0 into 0a and 0b and redo what I used to open 3 in 0b instead.
Also, how do you split 0 when you are in 3, without leaving 3? In tmux it is simply "split-window .0". Apparently there is no way to do that in vim...
Instead of consisting of a set of simple, powerful primitives, vim's window-manipulating commands are built from the perspective of special use cases. This makes these specific use cases easy but everything else hard. This is why I call them obscure.
- hsitz 12y agoThanks, I see what you mean. However, I think 'obscure' is the wrong word. Tmux seems to have analogous commands for most of Vim's, mapped to keys for use just like Vim's; they're simply the usual commands many people use to move windows(vim)/panes(tmux) around. The commands you mention (at least move-pane) are more flexible than Vim's window manipulation commands. That's the word I would use, 'flexible'. I think building a Vim plugin to emulate those tmux commands would be interesting project; I've put it on my list. One last thing. I'm curious what tmux command(s) you would use to transform the layout above back to its original state. In Vim it's quite simple, with cursor in your window 3, just issue command ':winc L'. I don't see anything as straightforward with the tmux commands you've described, but I could be missing something.