Skip to content

Instantly share code, notes, and snippets.

@program247365
Created September 4, 2012 19:41
Show Gist options
  • Save program247365/3625515 to your computer and use it in GitHub Desktop.
Save program247365/3625515 to your computer and use it in GitHub Desktop.
A nice tmux configuration
set -g default-terminal "screen-256color"
# act like GNU screen
unbind C-b
set -g prefix C-a
# Scroll with mouse, and select pane with mouse
setw -g mode-mouse on
setw -g mouse-select-pane on
# Resize Panes with mouse
set-option -g mouse-resize-pane on
# copy and paste for MacOSX (assumes you've 'brew install reattach-to-user-namespace' on your Mac)
set-option -g default-command "reattach-to-user-namespace -l bash" # or bash...
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# act like vim
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 :+
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 5
bind > resize-pane -R 5
bind _ resize-pane -D 5
bind + resize-pane -U 5
bind-key C-a last-window
bind-key a send-prefix
bind-key C-c new-window
unbind % # Remove default binding since we’re replacing
bind | split-window -h
bind - split-window -v
set -g base-index 1
#set -s escape-time 0
setw -g aggressive-resize on
# Set Status Bar
set -g status-fg black
set -g status-bg white
set -g status-left ""
set -g status-right "#[fg=blue]#h - %r"
set -g status-interval 1
set-window-option -g window-status-current-bg green
unbind p
bind-key p swap-pane -s 0 -t 1
set -g display-panes-time 3000
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment