Half-screen tiling layouts in tmux
When applying tmux’s main-horizontal
and main-vertical
layouts, I
prefer to have the main pane occupy half of the available screen space.
So, I wrote the following configuration snippet to achieve just that!
# main-vertical layout with the main pane occupying half of the screen
bind-key -n M-w select-layout main-horizontal \; run-shell 'tmux resize-pane -t 1 -y $(( #{window_height} / 2 ))'
# main-horizontal layout with the main pane occupying half of the screen
bind-key -n M-v select-layout main-vertical \; run-shell 'tmux resize-pane -t 1 -x $(( #{window_width} / 2 ))'