Shell CMDS – From any shell prompt:

start new:
tmux

start new with session name:
tmux new -s myname

attach:
tmux a  #  (or at, or attach)

attach to named:
tmux a -t myname

list sessions:
tmux ls

kill session:
`

TMUX CMDS – In tmux, hit the prefix ctrl+b and then:

Sessions

:new<CR>  new session
s  list sessions
$  name session

Windows (tabs)

c  new window
w  list windows
f  find window
,  name window
&  kill window

Panes (splits)

%  vertical split
”  horizontal split
o  swap panes
q  show pane numbers
x  kill pane
+  break pane into window (e.g. to select text by mouse to copy)
–  restore pane from window
  space – toggle between layouts
PREFIX q (Show pane numbers, when the numbers show up type the key to goto that pane)
PREFIX { (Move the current pane left)
PREFIX } (Move the current pane right)

Resizing Panes

You can also resize panes if you don’t like the layout defaults. I use the mouse to resize

PREFIX : resize-pane (By default it resizes the current pane down)
PREFIX : resize-pane -U (Resizes the current pane upward)
PREFIX : resize-pane -L (Resizes the current pane left)
PREFIX : resize-pane -R (Resizes the current pane right)
PREFIX : resize-pane 20 (Resizes the current pane down by 20 cells)
PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells)
PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells)
PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells)
PREFIX : resize-pane -t 2 20 (Resizes the pane with the id of 2 down by 20 cells)
PREFIX : resize-pane -t -L 20 (Resizes the pane with the id of 2 left by 20 cells)

Misc

d  detach
t  big clock
?  list shortcuts
:  prompt
z zoom

How do I copy and paste when the mouse select plane is enabled?
To copy/paste text in xterm running tmux on mac you simply hold down the option key and highlight the text you want to copy. On PC you hold down the shift key. If you are running split plane windows then you can zoom into the window you are interesting in copying text from using C-b z (prefix: z)

If you are a mac user an easier approach is to use Iterm2 and then under the preference, go to the general tab and check the allow clipboard access to terminal apps.

 

CONFIGURATIONS OPTIONS:
# Just click it
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-option -g mouse-resize-pane on

# Sane scrolling
set -g mode-mouse on

# Set the base index for windows to 1 instead of 0
set -g base-index 1

# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1

# set colors for the active window
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright

# pane colors
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg red

# Command / message line
set -g message-fg white
set -g message-bg black
set -g message-attr bright

# better mnemonics for splitting panes!
bind | split-window -h
bind \ split-window -h
bind – split-window -v
bind _ split-window -v

# Justify Status bar
set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on

# toggle statusbar
bind-key s set status

# scrollback buffer n lines
set -g history-limit 10000

# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on

# reload settings
bind-key R source-file ~/.tmux.conf

# tell tmux to use 256 colour terminal
set -g default-terminal “screen-256color”

# instructs tmux to expect UTF-8 sequences
setw -g utf8 on

# listen for activity on all windows
set -g bell-action any

# open a man page in new window
bind-key / command-prompt “split-window ‘exec man %%'”

# Broadcast input
bind-key S setw synchronize-panes

 

Source:
http://blog.yjl.im/2009/11/migrating-to-tmux-from-gnuscreen.html
http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
http://www.dayid.org/os/notes/tm.html
https://gist.github.com/shinzui/866897
https://gist.github.com/MohamedAlaa/2961058