detfalskested

tmux: Splitting panes with the same working directory

As a software developer, I often think about tweaking my configuration files as the equivalent of a butcher sharpening their knifes or a lumberjack sharpening their axe: It's something that you have to keep doing once in a while, to be able to do your job efficiently.

In my daily work, I rely heavily on tmux. And I just made a small tweak to the configuration of it that will make my everyday work more fun. Inspired by this gist, I changed my key bindings for splitting windows from this:

bind | split-window -h
bind - split-window -v

To this:

bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

Which will make new panes open in the same working directory as the one that was active when splitting.

I don't know why I haven't done this a long time ago.