Skip to content

Instantly share code, notes, and snippets.

@machty
Created February 19, 2013 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machty/4989557 to your computer and use it in GitHub Desktop.
Save machty/4989557 to your computer and use it in GitHub Desktop.
# mouse can be used to select panes
set-option -g mouse-select-pane on
# mouse can be used to select windows (by clicking in the status bar)
set-option -g mouse-select-window on
# mouse can be used to resize panes (by dragging dividers)
set-option -g mouse-resize-pane on
# not really sure what this does, but with it, the scrollwheel works inside Vim
set-option -g mouse-utf8 on
# allow mouse to enter copy mode and initiate selection
set-window-option -g mode-mouse on
set -g default-terminal "screen-256color"
# DO choose a title for me
setw -g automatic-rename on
# Use c-a as prefix
set -g prefix C-b
unbind C-a
bind C-b send-prefix
bind-key b send-key C-b
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# use hjkl for moving
# and HJKL for resizing
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
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
# shortcut for closing windows and panes
bind-key c kill-pane
bind-key q confirm-before kill-session
bind-key Q confirm-before kill-server
unbind o
bind o kill-pane -a
unbind c
bind w new-window
# Copy and pasting
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind C run "tmux save-buffer - | xclip -i -sel clipboard" \; run "tmux display \"Clipboard \(+\) filled with: $(tmux save-buffer - | dd ibs=1 obs=1 status=noxfer count=80 2> /dev/null)... \""
bind s choose-session
bind % split-window -v
bind v split-window -h
bind ` last-window
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# statusbar
set -g status-utf8 on
set -g status-interval 60
set -g status-left-length 40
set -g status-justify centre
set -g status-left "#[fg=green]#S"
set -g status-right "#[fg=cyan]%d %b %R"
set -g status-left-length 32
set -g status-right-length 150
set -g status-fg brightblue
set -g status-bg brightwhite
set -g window-status-activity-attr bold
set -g pane-border-fg brightgreen
set -g pane-active-border-fg brightgreen
set -g message-fg yellow
set -g message-bg white
set -g message-attr bold
set -g status-left '#[fg=white,bg=brightcyan,bold] ❐ #S #[fg=brightcyan,bg=brightyellow,nobold]⮀#[fg=brightcyan,bg=brightyellow,bold] #(whoami) #[fg=brightyellow,bg=brightwhite,nobold]⮀'
set -g window-status-format "#[fg=yellow,bg=brightwhite] #I #W "
set -g window-status-current-format "#[fg=brightwhite,bg=yellow]⮀#[fg=brightwhite,bg=yellow,noreverse,bold] #I ⮁ #W #[fg=yellow,bg=brightwhite,nobold]⮀"
set -g status-right "#(wemux status_users)"
# hostname color
#set -g status-left '#[fg=green]machty'
# right status and color
set -g status-right '#[fg=yellow]%A %v %l:%M %p'
# Fix tmux copy bug
set-option -g default-command "reattach-to-user-namespace -l $(basename $SHELL)"
# Load local configuration
source-file ~/.tmux.conf.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment