Illustration: terminal split into panes with code blocks
Illustration

I have been a tmux user for about eight years. For the first six of those, my config was a mess of pasted snippets that I did not really understand, with keybindings I half-remembered and plugins that did things I had long forgotten about. I used tmux because everyone I respected used tmux, not because I was getting much out of it.

Last year I deleted the whole thing and rebuilt it. Just under a hundred lines, every line earning its place. It finally clicked.

The mental shift

The unlock for me was realizing tmux is not a feature checklist — it is a window manager for the terminal. Once I framed it that way, the question stopped being “what cool plugins exist?” and became “what windows and panes do I actually use during a workday?” That second question has a much shorter answer.

For me, the answer is: an editor, a server process, a shell for running ad-hoc commands, and sometimes a log tail or a database client. That is it. Four kinds of panes per project. So my config optimizes for moving between those four things, opening new instances of them quickly, and detaching/reattaching by project name without thinking about it.

Framing it as a window manager also changed how I evaluate new additions. A plugin is not good because it is popular; it is good if it makes one of those four panes easier to reach, easier to watch, or easier to return to. Everything else is decoration, and decoration in a terminal is a cost disguised as a feature.

The prefix change

The default prefix is Ctrl-b. Almost everyone changes it. I went with Ctrl-a for a while like a lot of people, then switched to Ctrl-Space two years ago and never looked back. It is two thumb keys that do not conflict with anything else I do.

set -g prefix C-Space
unbind C-b
bind C-Space send-prefix

Worth the muscle-memory cost. I type the prefix dozens of times a day; the lower friction adds up. The lesson generalizes: the keys you press most often deserve the most ergonomic real estate, and a week of awkward retraining is cheap compared to years of a slightly annoying default.

Pane navigation that respects vim

The single highest-leverage thing in my config is vim-tmux-navigator. It lets Ctrl-h/j/k/l move between vim splits and tmux panes seamlessly. From my editor's perspective, my server process and my shell are just more splits.

This eliminated a whole class of context switches. Before, moving from “writing code” to “checking the test output that just ran in another pane” required hitting the prefix key first. Now it is just Ctrl-l. The pane border moves; nothing else changes.

That seamlessness is the whole point of a good multiplexer setup. The moment you have to think about which layer you are in — vim or tmux — the tool has failed at its one job, which is to make the layers disappear. One navigation scheme across both is what finally made tmux feel like part of my editor instead of a container around it.

Sessions named after directories

I open a new tmux session per project, named after the project. The trick that made this stick was a tiny shell function that does it in one keystroke:

tn() {
  local name=$(basename "$PWD" | tr . _)
  tmux new-session -A -s "$name"
}

I run tn from any project directory. If a session for that directory already exists, it attaches. If not, it creates one. Detach with prefix-d, switch projects with prefix-s, reattach to last with tmux attach. That is the whole project-switching workflow.

Combined with my remote dev setup, this means I can SSH into the box, type one command, and be back exactly where I left off — same panes, same vim sessions, same shell history. Persistence across disconnects is the feature that turns tmux from a convenience into infrastructure: your work survives a dropped connection, a closed laptop, and a reboot, as long as the session is still there.

The plugins I kept

I stripped my plugin list to four:

Things I removed and do not miss: tmux-yank (the system clipboard works fine on its own with modern terminals), tmux-battery (the status line was too cluttered), tmux-cpu (same), and a fancy theme that gave my status bar a gradient. Removing the gradient was the moment my status bar became readable.

The status bar

I went from a busy status line full of icons and percentages to one with three things: session name, current window list, and the time. That is it.

set -g status-style 'bg=#1c2030 fg=#c8ccd8'
set -g status-left '#[fg=#5de4a7,bold] #S #[default]| '
set -g status-right '#[fg=#6b7085]%H:%M '
set -g status-left-length 30

The session name on the left is the most useful piece of info I can put there — it tells me which project I am in. The clock on the right is a habit, mostly. Everything else is noise.

What I would tell someone starting

Do not copy a 400-line config from someone's dotfiles. You will inherit muscle memory for things you do not do and get nothing in exchange. Start with an empty config, add the prefix change, add session-by-directory, and stop. Use it for two weeks. Add things only when you notice yourself wanting them.

The reason my old config did not click is that I was using a tool shaped by other people's workflows. The reason this one does is that every line is shaped by a thing I actually do, ten times a day, on every project. There is no general-purpose “good tmux config.” There is just yours.

What I stopped trying to optimize

There is a second list that matters as much as the plugins I kept: the things I stopped trying to optimize. I stopped trying to make my status bar informative, because I never looked at the information. I stopped trying to make window switching clever, because clever switching is slower than obvious switching. I stopped trying to automate session setup beyond the one shell function, because the setup I actually do is simple enough that automating it further would save seconds and cost complexity.

Each of those decisions follows the same rule: optimize the thing you do ten times a day, and leave the thing you do once a month alone. The prefix, pane navigation, and session switching are ten-times-a-day things. Everything else is not, and the config is better for treating it that way. A config that tries to optimize everything ends up optimizing nothing, because every addition is a new thing to remember and a new thing that can break.

The result is a setup I can explain to someone in two minutes, which is a test I now apply to all my tooling. If I cannot explain a config in two minutes, I probably do not understand it well enough to keep it. The old config failed that test. The new one passes it, and that is a large part of why it finally clicked.