Skip to content

Instantly share code, notes, and snippets.

@jredville
Created March 5, 2013 18:29
Show Gist options
  • Save jredville/5092840 to your computer and use it in GitHub Desktop.
Save jredville/5092840 to your computer and use it in GitHub Desktop.
My current tmux conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
# http://blog.yjl.im/2009/11/migrating-to-tmux-from-gnuscreen.html
# http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
# http://www.dayid.org/os/notes/tm.html
# http://gist.github.com/721200
# http://justinlilly.com/dotfiles/tmux.html
#
# Other sample tmux.conf files
#
# http://www.mindfuzz.net/?p=178
# https://github.com/zolrath/dotfiles/blob/master/tmux.conf
#
# -----------------------------------------------------------------------------
# Global settings
set-environment -g INSCREEN yes
set-environment TMUX_TITLE yes
set -g default-terminal "screen-256color"
set -g default-command "reattach-to-user-namespace -l zsh"
# Allow switching currently focused pane by mouse click
set -g mouse-select-window on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-utf8 on
setw -g mode-mouse on
# Note, my prefix is ^F
#
# Toggle mouse on with ^F m
#bind m \
#set -g mode-mouse on \;\
#set -g mouse-resize-pane on \;\
#set -g mouse-select-pane on \;\
#set -g mouse-select-window on \;\
#display 'Mouse: ON'
# Toggle mouse off with ^F M
#bind M \
#set -g mode-mouse off \;\
#set -g mouse-resize-pane off \;\
#set -g mouse-select-pane off \;\
#set -g mouse-select-window off \;\
#display 'Mouse: OFF'
#title
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' #window, program name, active or not
set -g automatic-rename off
#bell in current window
set-option -g bell-action any
set-option -g visual-bell on
#C-z as prefix
set -g prefix C-a
unbind-key C-b
bind-key ` last-window
bind-key C-a send-prefix
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
setw -g aggressive-resize on
setw -g monitor-activity on
set -g visual-activity on
#status line
set-option -g status-utf8 on
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
setw -g mode-bg colour221
setw -g mode-fg colour16
setw -g mode-attr bold
set -g status-interval 15
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
set -g status-right '#[fg=colour234,bg=colour41]⮀#[fg=colour235,noreverse,bold] C#(battery Charging) #[fg=colour245,bg=colour52,noreverse,bold] D#(battery Discharging) #[fg=colour52,bg=colour234]⮀ #[fg=colour234,bg=colour252]⮀#[fg=colour235,bold] ❐ %b-%d %I:%M %p'
# Highlight active window
set-window-option -g window-status-current-bg red
#large history
set -g history-limit 100000
#key bindings
setw -g mode-keys vi
unbind [
bind [ copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
bind y run "tmux save-buffer - | reattatch-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# SSH in new pane
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
# log output to a text file on demand
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
bind | split-window -h
bind - split-window -v
# select pane with home keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# select windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# 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
# maximize and restore a pane
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment