tmux-Area auf la-familia-grande.de

Sessions


New Session

tmux new [-s name] cmd(:new) new session

Switch Session

tmux ls(:ls) list sessions
tmux switch [-t name](:switch) switches to an existing session
tmux as [id] [-t name](:attach) attaches to an existing session
<C-y> c(:detach)detach the currently attached session

Session Management

<C-y> slist sessions
<C-y> $name session

Close Session

tmux kill-session [-t name](:kill-session)

Windows


New Window

<C-y> c(:neww [-n name] [cmd]) new window

Cursor Movement

<C-y> [i](:selectw -t [i])go to window [i]
<C-y> lgo to last window
<C-y> pgo to previous window
<C-y> ngo to next window

Window Management

<C-y> Trename window
<C-y> ,rename window
<C-y> Wlist all windows
<C-y> ffind window by name
<C-y> .move window to another session (prompt)
(:movenew)move window to next unused number

Close Window

<C-y> &(:kill-window)kill window

Panes


New Pane

<C-y> %(:splitw [-v] [-p width] [-t focus] [cmd])split current pane vertically
<C-y> "(:splitw -h [-p width] [-t focus] [cmd])split current pane horizontally

Cursor Movement

<C-y> o(:selectp -t :.+)move cursor to the next pane
<C-y> <Up>(:selectp -U)move cursor to the pane above
<C-y> <Down>(:selectp -D)move cursor to the pane below
<C-y> <Left>(:selectp -L)move cursor to the pane to the left
<C-y> <Right>(:selectp -R)move cursor to the pane to the right

Panes Management

(:swap-pane -U)move current pane up
(:swap-pane -D)move current pane down
<C-y> {(:swap-pane -L)move current pane to the left
<C-y> }(:swap-pane -R)move current pane to the right
<C-y> q show pane numbers (type number to move cursor)
<C-y> <Space> toggle pane arrangements

Resize Pane

(:resize-pane -U [i])move horizontal divider up by [i] lines
(:resize-pane -D [i])move horizontal divider down by [i] lines
(:resize-pane -L [i])move vertical divider left by [i] columns
(:resize-pane -R [i])move vertical divider right by [i] columns
(:resize-pane [-DLRUZ] [-x width] [-y height] [-t target-pane] [adjustment])

Close Pane

<C-y> x(:kill-pane)kill current pane

Misc


<C-y> tshow time
<C-y> rreload config (~/.tmux.conf)

Config

~/.tmux.conf


# mit prefix-r die tmux config neu einlesen
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."

# Crtl+Y als zusätzlichen Prefix-Key einstellen
set-option -g prefix2 C-y
#unbind-key C-b
bind-key C-y send-prefix

# Inhalt der Infoleiste ändern:
set -g status-interval 2
set -g status-left '[#S]'
set -g status-right '%l:%M'
set-option -g status-justify left
set-window-option -g window-status-current-format '#I:#W#F'
set-window-option -g window-status-format '#I:#W#F'
set -g status-keys vi
set -g status-position top
setw -g automatic-rename on

# Farb-Optionen fuer Shell-Fenster
set-option -g default-terminal screen-256color

# Aussehen der Infoleiste ändern:
set-option -g status on
set-option -g status-bg blue
set-option -g status-fg white
set-window-option -g window-status-current-bg yellow
set-window-option -g window-status-current-fg black

# Aussehen der Kommandozeile ändern:
set -g message-fg white
set -g message-bg yellow
set -g message-attr bright

# Aussehen von Teilfenstern ("Panes") anpassen:
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg blue

# Aktive Shell-Fenster visuell hervorheben:
setw -g monitor-activity on
set -g visual-activity on

# Automatische Neu-Nummerierung der Fenster aktivieren:
# (Beispielsweise nach dem Schließen eines Fensters)
set -g renumber-windows on

# Buffer-Länge einstellen
set -g buffer-limit 1000
set -g history-limit 1000

# When enabled, focus events are requested from the terminal if supported and
# passed through to applications running in tmux.  Attached clients should be
# detached and attached again after changing this option.
set -g focus-events on

# Maus Einstellungen
set -g mouse on
# mit der mittleren Taste wollen wir zoomen
bind-key -T root MouseDown2Pane resize-pane -Z -t =
# For vi copy mode bindings
bind-key -t vi-copy MouseDragEnd1Pane copy-pipe "xclip -selection clipboard -i"
# For emacs copy mode bindings
bind-key -t emacs-copy MouseDragEnd1Pane copy-pipe "xclip -selection clipboard -i"

# Attempt to set the terminal clipboard content using the \e]52;...\007 xterm(1)
# escape sequences.
set -g set-clipboard on


# Fenster-Titel
set -g set-titles on

# Monitor und Bell-Einstellungen
set -g bell-on-alert on
set -g visual-activity on
set -g visual-bell on
setw -g monitor-activity on
setw -g monitor-silence 2000
setw -g pane-border-status bottom