← Back to all TILs

Add Bindings To Split Panes To Current Directory

tmux Written October 30, 2025

When I am vertically or horizontally splitting a pane or opening another window, I generally want it to open to the same directory as I'm currently in. The default behavior in tmux is for those commands to open to the starting directory of the session.

Looking through the tmux.conf in dkarter/dotfiles, I found a good way to achieve the behavior I want.

bind-key - split-window -v  -c '#{pane_current_path}'
bind-key \\ split-window -h  -c '#{pane_current_path}'
bind-key c new-window -c '#{pane_current_path}'

What I like about this is that - (vertical) and \ (horizontal) look visually like the splits they represent. Meanwhile, I leave % and " intact.

Other posts like this