Permalink
Browse files

Add tmux setup

  • Loading branch information...
1 parent 937318b commit e7174c76e8e8d7229867a902d7a740da59501ea7 @skalnik committed Apr 22, 2012
Showing with 92 additions and 0 deletions.
  1. BIN bin/reattach-to-user-namespace
  2. +92 −0 tmux/tmux.conf.symlink
Binary file not shown.
View
@@ -0,0 +1,92 @@
+# C-a as a prefix; similar to GNU screen
+set -g prefix C-a
+unbind C-b
+
+# Shorter command delay; apparently otherwise vim is unhappy
+set -sg escape-time 1
+
+# 1-based window indexes
+set -g base-index 1
+setw -g pane-base-index 1
+
+# Reload .tmux.conf with prefix-r
+bind r source-file ~/.tmux.conf \; display "Reloaded!"
+
+# C-a for switch between last active window
+bind-key C-a last-window
+
+# prefix-| splits vertically
+# prefix-- splits horizontally
+bind | split-window -h
+bind - split-window -v
+
+# Moving among panes
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# Resizing 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
+
+# Mouse is sometimes useful
+setw -g mode-mouse on
+
+# .. but not for these things
+set -g mouse-select-pane off
+set -g mouse-resize-pane off
+set -g mouse-select-window off
+
+# 256 colors
+set -g default-terminal "screen-256color"
+
+# Colors
+set -g status-fg white
+set -g status-bg black
+setw -g window-status-fg cyan
+setw -g window-status-bg default
+setw -g window-status-attr dim
+setw -g window-status-current-fg white
+setw -g window-status-current-bg red
+setw -g window-status-current-attr bright
+set -g pane-border-fg green
+set -g pane-border-bg black
+set -g pane-active-border-fg white
+set -g pane-active-border-bg black
+set -g message-fg white
+set -g message-bg black
+set -g message-attr bright
+
+# Status bar
+set status-right "%H:%M %e %h %Y"
+set -g status-interval 60
+set -g status-utf8 on
+
+# Activity in other windows
+setw -g monitor-activity on
+
+# vi keys, especially for copy mode
+setw -g mode-keys vi
+unbind p
+bind p paste-buffer
+bind -t vi-copy 'v' begin-selection
+bind -t vi-copy 'V' begin-selection
+bind -t vi-copy 'y' copy-selection
+
+# Maximizing panes
+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
+
+# OS X keyboard
+# Requires [tmux-MacOSX-pasteboard](https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard)
+set -g default-command "which reattach-to-user-namespace && reattach-to-user-namespace -l $SHELL || $SHELL"
+
+
+# OS X copying
+bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
+bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"

0 comments on commit e7174c7

Please sign in to comment.