.tmux.conf

From Mann Systems
Jump to: navigation, search
# dotfiles/tmux.conf

##### Server options
# Remove the wait for another key after escape pressed
set-option -gs escape-time 0

##### Session options

# Set terminal type inside tmux
set-option -g default-terminal screen-256color
# Window scrollback lines
set-option -g history-limit 2000
# Enable mouse support
#set-option -g mouse on
# Change prefix key from C-b to C-a
set-option -g prefix C-b
set-option -g prefix2 C-a
# Attempt to set the client terminal title
set-option -g set-titles on
set-option -g set-titles-string "#{host_short}:tmux:#{session_name}:#{window_index}:#{window_name}"
# Update environment variables when starting new or attaching to existing session
#set-option -g update-environment

##### Window options
# Allow programs to change window name
set-window-option -g allow-rename off
# Automatically rename window 
set-window-option -g automatic-rename on
set-window-option -g automatic-rename-format "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
# Monitor window activity
set-window-option -g monitor-activity on

##### Key bindings
# Change send-prefix from C-b to a
#bind-key b send-prefix
bind-key a send-prefix -2

# And use C-a for last-window, a la GNU Screen
bind-key C-a last-window

# ctrl+d detaches client too, in case CTRL still held down
bind-key C-d detach-client

# Split panes using | and - instead of " and %
bind-key | split-window -h
bind-key - split-window -v
unbind-key '"'
unbind-key %

# Fast pane switching with ALT+arrow
bind-key -n M-left select-pane -L
bind-key -n M-right select-pane -R
bind-key -n M-up select-pane -U
bind-key -n M-down select-pane -D

# <prefix> R reloads config
bind-key R source-file ~/.tmux.conf

bind-key t choose-tree

### Appearance settings

# Centre part of status bar (window list)
#set-option -g status-justify left
set-option -g status-style bg=colour004

# Left part of status bar
set-option -g status-left "[#{session_name}] "
set-option -g status-left-length 15
#set-option -g status-left-style "bg=colour007,fg=colour000"

# Right part of status bar
set-option -g status-right " #{host_short} %F %R "
#set-option -g status-right-length 30
#set-option -g status-right-style "bg=colour234,fg=colour231"

#set-option -g message-style bg=black,fg=yellow
#set-option -g message-command-style bg=yellow,fg=black

### Window list items
# Default
set-window-option -g window-status-style fg=colour007
#set-window-option -g window-status-format " #I #W#F "

# Currently selected window
set-window-option -g window-status-current-style bg=colour012,fg=colour015
#set-window-option -g window-status-current-format " #I #W#F "

# Last-selected window
set-window-option -g window-status-last-style fg=colour015

# Windows with activity or BEL
set-window-option -g window-status-activity-style fg=brightyellow
set-window-option -g window-status-bell-style fg=colour009

### Default styles of the window contents
#set-window-option -g window-style ""
#set-window-option -g window-active-style ""