arindam89
11/17/2013 - 8:05 AM

My custom tmux configuration for better productivity.Don't forget to install reattach-to-user-namespace in OSX for copy paste to work correc

My custom tmux configuration for better productivity.Don't forget to install reattach-to-user-namespace in OSX for copy paste to work correctly.http://robots.thoughtbot.com/how-to-copy-and-paste-with-tmux-on-mac-os-x

set -g prefix C-a
unbind C-b
bind C-a send-prefix

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"


# Change the default delay
set -sg escape-time 1

# Fix the base indexes 
set -g base-index 1
setw -g pane-base-index 1

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

# Vim like select pane
bind-key k select-pane -U
bind-key j select-pane -D
bind-key h select-pane -L
bind-key l select-pane -R

# Similar resize pane bindings
bind -r H resize-pane -L 5 
bind -r J resize-pane -D 5 
bind -r K resize-pane -U 5 
bind -r L resize-pane -R 5

# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+

# I want mouse to be active inside tmux
setw -g mode-mouse on
set -g mouse-select-pane on 
set -g mouse-resize-pane on 
set -g mouse-select-window on

# Force set 256 color terminal
set -g default-terminal "screen-256color"

# Set colors for the status bar
set -g status-fg white
set -g status-bg black

# setw is a shortcut for set-window-option
setw -g window-status-fg cyan 
setw -g window-status-bg default 
setw -g window-status-attr dim
setw -g window-status-current-fg white 
setw -g window-status-current-bg red
setw -g window-status-current-attr bright

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 yellow

set -g message-fg white 
set -g message-bg black 
set -g message-attr bright

# Setting the status bar for tmux
# First setting the left panel
# it shows the session name in green, the current window number in yellow, and the current pane in cyan.
set -g status-utf8 on
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"

# Set the right panel
set -g status-right "#[fg=cyan]%d %b %R"

# Center the window list of the status bar
set -g status-justify centre

# Refresh the status bar every minute.
set -g status-interval 60

# Enable visual activity
setw -g monitor-activity on 
set -g visual-activity on

#Use vim keybindings in copy mode
setw -g mode-keys vi

# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"