Skip to content

Instantly share code, notes, and snippets.

@zph
Created January 4, 2013 05:38
Show Gist options
  • Save zph/4450207 to your computer and use it in GitHub Desktop.
Save zph/4450207 to your computer and use it in GitHub Desktop.
# CAVEATS
# on Linux - delete any lines referencing reattach-to-user-namespace
# on OSX - run `brew install reattach-to-user-namespace`
set -g prefix C-a
unbind C-b
bind C-a send-prefix
bind C-z send-prefix
bind-key C-a last-window
bind-key C-z last-window
unbind % # Remove default binding since we’re replacing
bind | split-window -h
bind - split-window -v
set -g display-panes-time 2500
bind-key f display-panes
setw -g automatic-rename
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
set -g status-right '#[fg=blue]#(date +%H:%M:%S)---#(uptime | awk "{print $10,$11,$12}")'
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
set -g pane-active-border-fg red
# Enable mouse support (works in iTerm)
# per Pivotal Labs
set-window-option -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-resize-pane on
set-option -g mouse-select-window on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
set-option -g mouse-select-pane off
set-option -g mouse-resize-pane off
set-option -g mouse-select-window off
set-window-option -g mode-mouse off
# Highlight active window
set-window-option -g window-status-current-bg red
# VIM movements
set-window-option -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# VIM Keybind resizing
bind-key J resize-pane -D
bind-key K resize-pane -U
bind-key H resize-pane -L
bind-key L resize-pane -R
set -g default-terminal "screen-256color"
# Commands to integrate reattach-to-user-namespace
# http://www.drbunsen.org/text-triumvirate.html
set -g default-command "reattach-to-user-namespace -l zsh"
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
# Copy mode
setw -g mode-keys vi
bind ` copy-mode
unbind [
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 - | reattach-to-user-namespace pbcopy"
# Powerline configuration for Tmux
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
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]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment