18

I usually have two horizontal panes as such:

+–––––––––+–––––––––+
|                   |
|                   |  
|                   |
+–––––––––+–––––––––+
|                   |
|                   |
|                   |
+–––––––––––––––––––+

But would like to do a full-horizontal split like this:

+–––––––––+–––––––––+
|         |         |
|         |         |  
|         |         |
+–––––––––|         |
|         |         |
|         |         |
|         |         |
+–––––––––––––––––––+

Whenever I do a split, it turns out like this:

+–––––––––+–––––––––+
|         |         |
|         |         |  
|         |         |
+–––––––––+–––––––––+
|                   |
|                   |
|                   |
+–––––––––––––––––––+

So, I was wondering if there was a command that would do a full length vertical split. Thanks!

Edit: I forgot to mention that I wanted to only use one command to go from the first image to the second image.

1

2 Answers 2

18

From the manual [emphasis mine]:

split-window [-bdfhIvPZ] [-c start-directory] [-e environment] [-l size] [-t target-pane] [shell-command] [-F format]

(alias: splitw)

Create a new pane by splitting target-pane: -h does a horizontal split and -v a vertical split; if neither is specified, -v is assumed. […] The -b option causes the new pane to be created to the left of or above target-pane. The -f option creates a new pane spanning the full window height (with -h) or full window width (with -v), instead of splitting the active pane. […]

The tmux command you need is split-window -hf. You can bind it to a key like any other tmux command (e.g. bind-key -T prefix ^ split-window -hf in ~/.tmux.conf; remember the file is read when you (re)start the tmux server or explicitly reload the file (prefix:source ~/.tmux.confEnter)).

In a shell the command will be this:

tmux split-window -hf
25

You could do the following:

ctrl + b + % to make a vertical split.

ctrl + b + " to make a Horizontal split.

ctrl + b + left arrow to move to the left pane.

ctrl + b + " to make a Horizontal split.

and so you would have the four panels.

2
  • Thanks! I accidentally omitted some important notes, but I was looking for one command that would essentially do a full length vertical split. Commented Jan 29, 2022 at 19:58
  • a bit late, but: after you have split your window with a horizontal bar you cannot split it again with "full length vertical" bar (what would lead to a kind of cross in your terminal window). You could only split one pane at a time, in this case the upper OR the lower one. What you can do is press crtl+b+% (or " - for this case it doesn't matter) three times and then press ctrl+b alt+5 - that organizes your window to contain 4 equally sized panes (you could give alt+1, alt+2, alt+3, alt+4 also a try ;-)
    – Gerd
    Commented Apr 17 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .