I've been a tmux user for about eight years. For the first six of those, my config was a mess of pasted snippets that I didn't really understand, with keybindings I half-remembered and plugins that did things I'd 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's 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's 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.
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's two thumb keys that don't 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.
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's just Ctrl-l. The pane border moves; nothing else changes.
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's 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.
The plugins I kept
I stripped my plugin list to four:
- tmux-plugins/tpm — the plugin manager. Required for the others.
- tmux-resurrect + tmux-continuum — saves and restores sessions across reboots. The continuum auto-save runs every 15 minutes. I rebooted last week and lost zero context.
- vim-tmux-navigator — covered above.
Things I removed and don't 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's 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'm in. The clock on the right is a habit, mostly. Everything else is noise.
What I'd tell someone starting
Don't copy a 400-line config from someone's dotfiles. You'll inherit muscle memory for things you don't 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 didn't 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's no general-purpose "good tmux config." There's just yours.