Skip to content

Instantly share code, notes, and snippets.

@raine
Created March 29, 2012 10:57
Show Gist options
  • Select an option

  • Save raine/2235847 to your computer and use it in GitHub Desktop.

Select an option

Save raine/2235847 to your computer and use it in GitHub Desktop.
set -g base-index 1
setw -g mode-keys vi
set -g default-terminal "screen-256color"
# act like GNU screen
unbind C-b
set-option -g prefix C-f
setw -g aggressive-resize on
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# 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 10
bind > resize-pane -R 10
bind - resize-pane -D 10
bind + resize-pane -U 10
# some hack that makes pbcopy work
# set-option -g default-command "reattach-to-user-namespace -l bash"
set-option -g default-command "reattach-to-user-namespace -l zsh"
# set-option -g default-shell /bin/zsh
set -s escape-time 0
set-option -g pane-active-border-fg colour10
set-window-option -g window-status-current-bg colour1
set-window-option -g window-status-current-fg colour15
# bind C-y save-buffer /tmp/tmux-buffer \; run-shell "reattach-to-user-namespace -l zsh -c 'cat /tmp/tmux-buffer|pbcopy'"
bind C-y run-shell "reattach-to-user-namespace -l zsh -c 'tmux saveb - | pbcopy'"
bind-key C-f last-window
bind-key a send-prefix
new-session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment