Tmux Quick-Start

This document is intended to provide an at-a-glance reference to help me adopt Tmux as a superior alternative to Screen in my development endeavors.


Basic Commands

tmux : start a new unnamed session
tmux new -s <name> : start a new named session
tmux ls : list sessions
tmux a <#> : attach to a session by number
tmux a -t <name> : attach to a session by name
tmux kill-session : kill session
tmux kill-session -t <name> : kill session by name

Config

This is my current configuration, I will update any changes here.

# Set a shortcut for reloading tmux config                                                                            
bind r source-file ~/.tmux.conf

# Rename your terminals
set -g set-titles on
set -g set-titles-string '#(whoami)#(curl ipecho.net/plain;echo)#'

# Status bar customization
set -g status-utf8 on
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
set -g status-left "#[fg=Green]#(whoami)#[fg=white]:#[fg=blue]#(hostname -s)#[fg=white]:##[fg=yellow]#(curl ipecho.net/plain;echo)    "
 
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'

# Use bash (and its prompt format)
set-option -g default-command bash

Windows

c : create window
& : kill window
, : name window
w : list windows
n : next window
p : previous window
f : find window

Panes

% : split pane vertically
" : split pane horizontally
x : destroy pane
o : cycle panes
q : display pane numbers
+ : break pane into window (free selection)
- : restore pane from window
_ : space - toggle between layouts
q : show pane numbers, number keys enter
z : pane zoom (toggles)
{ : move the current pane left
} : move the current pane right

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.