Skip to content

Instantly share code, notes, and snippets.

@wickett
Created August 30, 2013 21:43
Show Gist options
  • Save wickett/6394562 to your computer and use it in GitHub Desktop.
Save wickett/6394562 to your computer and use it in GitHub Desktop.
# From https://raw.github.com/chrishunt/dot-files/master/.tmux.conf
###########################
# Configuration
###########################
#use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# disable mouse
setw -g mode-mouse off
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
#start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# re-number windows when one is closed
set -g renumber-windows on
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
###########################
# Key Bindings
###########################
# tmux prefix
unbind C-b
unbind C-a
set -g prefix C-a
# window splitting
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
# resize panes
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
# create 25% lower split
unbind t
bind t split-window -p 25
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Copy and pasting, for reattach-to-user-namespace, do brew install reattach-to-user-namespace
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe, see note above on brew install reattach-to-user-namespace
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Quick window selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
###########################
# Status Bar
###########################
# enable UTF-8 support in status bar
set -g status-utf8 on
# set refresh interval for status bar
set -g status-interval 30
# center the status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S#[fg=blue] #I:#P#[default]'
# show hostname, date, time, and battery in right status bar
set-option -g status-right '#[fg=green]#H#[default] %m/%d/%y %I:%M [fg=red]#(battery discharging)#[default]#(battery charging)'
# dynamically update iTerm tab and window titles
set -g set-titles on
# but don't change tmux's own window titles
set -w -g automatic-rename off
# #T = standard window title (last command, see ~/.bash_profile)
# #h = short hostname
# #S = session name
# #W = tmux window name
# (would love to include #(pwd) here as well, but that would only print the
# current working directory relative to the session -- ie. always the starting
# cwd -- which is not very interesting)
set -g set-titles-string "#T : #h > #S > #W"
###########################
# Colors
###########################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment