Pane ManagementPrefix + % (horizontal), Prefix + " (vertical)
split-window
Short form: splitw
Create a new pane by splitting the current pane. The -h flag splits horizontally (creates panes side by side), and -v splits vertically (creates panes above/below).
Synopsis
bash
tmux split-window [-bdfhIvPZ] [-c start-directory] [-e environment] [-F format] [-l size] [-t target-pane] [shell-command]Options
| Flag | Description |
|---|---|
| -h | Split horizontally (panes side by side) |
| -v | Split vertically (panes above/below, default) |
| -b | Create new pane before (left of or above) |
| -f | Create new pane spanning full width/height |
| -l size | Specify size (lines/columns or percentage) |
| -c start-directory | Specify starting directory |
| -d | Don't make new pane the active pane |
Examples
Split vertically (default)
bash
tmux split-windowSplit horizontally (side by side)
bash
tmux splitw -hSplit with 20 lines for new pane
bash
tmux splitw -v -l 20Split with 30% width for new pane
bash
tmux splitw -h -l 30%Split in current directory
bash
tmux splitw -c '#{pane_current_path}'Split and run htop
bash
tmux splitw 'htop'Default Keybinding
Prefix + % (horizontal), Prefix + " (vertical)
Default prefix is Ctrl+b
Pro Tips
- •Note: tmux's horizontal/vertical is confusing - -h creates a vertical divider (panes side by side)
- •Add these to .tmux.conf for intuitive splits: bind | split-window -h && bind - split-window -v
- •Use -c '#{pane_current_path}' to inherit the current directory