This document discusses tips and tricks for using the terminal multiplexer Tmux. It covers keeping the Tmux configuration file short, managing windows and sessions, and fast session switching. Specifically, it recommends keeping the configuration file simple, creating windows and sessions liberally for each project rather than tightly managing them, and using a plugin for fast session switching by name rather than visually browsing sessions.
2. Overview
1. keeping .tmux.conf short
2. tmux workflow: managing windows & sessions
3. fast session switching
3. 1. keeping .tmux.conf short
• *huge* tmux.conf files with 200+ LOC
• “community standard” key bindings + plugins:
tmux-sensible
tmux-pain-control
• build your own plugin
4. 2. managing windows &
sessions
Classic tmux workflow
• conservative number of sessions
Eg: 2 sessions ‘work’ and ‘private’
• 1 session = many projects
• highly maintained list of windows and panes
• strict window layouts
5. 2. managing windows &
sessions
Recommended workflow
• terminals are “cheap”: create windows & sessions liberally
• no need to “manage” or “delete” unused panes, windows or
sessions
• 1 session = 1 project works well
• create window layout on the go (because it’s fast and easy)
• *everything* should be fast and easy
6. 3. fast session switching
• problem with a large number of
sessions
• `prefix + s` does not work for 5+
sessions.
It takes too long to “visually” find the
desired session and switch to it.
7. 3. fast session switching
• recommendation:
tmux-sessionist plugin `prefix + g`
• principle:
- tell tmux what to do
- don’t “visually parse”
Credit: Gary Bernhardt and his vim tips
8. 3. fast session switching
• you already know where you want to “go”
• session name completion