Tmux
Working from neovim and writing go code I find myself often cycling through multiple terminal windows while working on projects. This cycles between iterm and ghostty terminal and splits within neovim itself depending on my environment. Often resulting in a cacophony of windows, panes, and red yarn connecting the dots... There has to be a better way. Or moreover I'm tired of relying on a different set of application keybindings, alt-tab, and my mouse. The overall design of my workflow is to keep laser focus by keeping everything within a single window, and reducing the amount of time switching between different programs or reaching for the mouse. Tmux has always been the obvious answer for improvement.
What is Tmux
Tmux is a terminal multiplexer, or a program run from within a terminal that allows for running multiple terminals, all accessed from a single terminal. Tmux is also useful for running detached commands. Detached commands are particularly useful for long running commands, or commands running over SSH, where a break in connection could terminate the running command.
My Tmux Newborn Workflow
Goals
- quickly navigate between writing, executing, and testing code
- group projects together by context (e.g. leave side project Bookworm and main work projects in a state where I can easily jump between them)
Tmux Sessions
tmux
- makes a new tmux session and drops you into the session. Session will be giving a numeric, autoincrementing name, starting with 0tmux new -s <session-name>
- Creates a new session with the provided nametmux a -t <session-name>
- Reattaches to a session by nameprefix + d
- detach from a tmux session, and keep it running for later
Note: I've remapped my tmux prefix from c-b to c-a
Window Management
prefix + c
- makes a new windowprefix + [0-9]
- jump to specific windowprefix + w
- a select list of all windows
My Custom Tmux Config
1# My brain does better with base index 1 when pressing `prefix [0-9]
2set -g base-index 1
3
4# Set the prefix to Ctrl+a
5set -g prefix C-a
6
7# Remove the old prefix
8unbind C-b
9
10# Send Ctrl+a to applications by pressing it twice
11bind C-a send-prefix
12
13# Better colors
14set -g status-style 'bg=#333333 fg=#5eacd3'
15
16# vim-like pane switching
17bind -r ^ last-window
Hello World Example

tmux session

executing code in tmux window

testing code in tmux window
What's Next
Look more into tmux sessionizer and continue to improve my local tmux config.
This post's permalink is https://zietlow.io/posts/2025/tmux/ and has the following summary:
Working from neovim and writing go code I find myself often cycling through multiple terminal windows while working on projects. This cycles between iterm and ghostty terminal and splits within neovim itself depending on my environment. Often resulting in a cacophony of windows, panes, and red yarn connecting the β¦
The canonical URL for this post is https://zietlow.io/posts/2025/tmux/