tmux config file

Updated . Posted . Visible to the public.

This is my basic tmux config file.

Features:

  • Pane switching with Alt-Arrow keys.
  • Select pane with mouse click.
  • Reload configuration without restarting tmux.
  • More intuitive keybindings for splitting.
  • Cute statusbar, see attached screenshot for an idea of the resulting statusbar.

.tmux.conf

# set prefix key to ctrl+o
unbind C-b
set -g prefix C-o
bind-key C-o last-window

# reload config without killing server
bind r source-file ~/.tmux.conf

# more intuitive keybindings for splitting
unbind %
unbind '"'

bind - split-window -v
bind _ split-window -v
bind | split-window -h

# Cool: Pane switching with Alt+arrow
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

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

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

# on-screen time for display-panes in ms
set -g display-panes-time 2000

# start window indexing at one instead of zero
set -g base-index 1

# enable wm window titles
set -g set-titles on

# Enable mouse selection of things
set-option -g mouse-select-pane on
setw -g mode-mouse on

# disable auto renaming
# setw -g automatic-rename off

# border colours
set -g pane-active-border-bg default

# wm window title string (uses statusbar variables)
set -g set-titles-string "tmux:#I [ #W ]"

# statusbar --------------------------------------------------------------
set -g status-interval 2
set -g status-justify centre # center align window list
set -g status-left-length 25
set -g status-left '#[fg=green] #H #[fg=black] %d-%m-%Y %H:%M #[default]'
set -g status-right '#[fg=blue,bright]Up #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=black] #[fg=cyan,bright]#(cut -d " " -f 1-4 /proc/loadavg) '

# default statusbar colors
set -g status-fg white
set -g status-bg default
set -g status-attr bright


# In order to 256 colors to work, you have to set this environment var before starting tmux:
# export TERM="xterm-256color"

set -g default-terminal "xterm-256color"

# default window title colors
setw -g window-status-format         "#[fg=black]#[bg=white] #I #[bg=default]#[fg=colour245] #W "
setw -g window-status-current-format "#[fg=colour232]#[bg=colour39] #I #[bg=default]#[fg=colour190] #W "


set-window-option -g window-status-fg white
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim

# active window title colors
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright
set-window-option -g window-status-current-fg yellow

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

#Clear scrollback history 
# Fuente: http://stackoverflow.com/questions/10543684/how-can-i-clear-scrollback-buffer-in-tmux
bind -n C-h clear-history

# Enable scrolling using Shift-PageUp/PageDown:
#  http://www.electricmonk.nl/log/2012/01/05/tmux-scrolling-with-shift-pageupdown/
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
Saul
Last edit
Attachments
Keywords
.tmux.conf
Posted by Saul to Saul (2012-12-14 01:50)