Skip to content

Instantly share code, notes, and snippets.

@zph
Created July 14, 2013 17:59
Show Gist options
  • Save zph/5995109 to your computer and use it in GitHub Desktop.
Save zph/5995109 to your computer and use it in GitHub Desktop.
--- .tmux_twymer 2013-07-13 20:19:45.000000000 -0400
+++ .tmux.conf 2013-07-14 00:05:59.000000000 -0400
@@ -1,31 +1,69 @@
-# References:
-#http://mutelight.org/articles/practical-tmux
-# Use screen shortcut
-set-option -g prefix C-a
-
-# C-a twice to jump between windows
+# 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
-# Kill escape key hang that makes vim feel laggy
-set -s escape-time 0
+set -g display-panes-time 2500
+bind-key f display-panes
+# setw -g automatic-rename
-# Status bar
+
+
+# Set status bar
set -g status-bg black
set -g status-fg white
-set -g status-left ""
-set -g status-right "#[fg=green]#H"
+set -g status-left '#[fg=green]#H'
+
+set -g status-right '#[fg=blue]#(date +%H:%M:%S)---#(uptime | awk "{print $10,$11,$12}")'
-# Rebind vim keys for pane selection
-bind-key h select-pane -L
-bind-key ^H select-pane -L
-bind-key k select-pane -U
-bind-key ^K select-pane -U
-bind-key j select-pane -D
-bind-key ^J select-pane -D
-bind-key l select-pane -R
-bind-key ^L select-pane -R
-# Shortcuts for resizing pane
+# 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
+### Experimental
+#
+# Adopted from @twymer's dotfiles
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
@@ -34,28 +72,65 @@
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
+#########
-# Let us send Ca a to remote tmux sessions
-# bind-key a send-prefix
+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
+set -g mouse-resize-pane on
+set -g mouse-select-pane on
+set -g mouse-select-window on
+
+# Copy mode
+unbind [
+bind ` copy-mode
+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]"
-# Example of using a shell command in the status line
-#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
-set -g status-right '#[fg=green][#[fg=white]#T#[fg=green]][#[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]#[fg=green]]'
+# Adopted from @twymer's dotfiles
+# Kill escape key hang that makes vim feel laggy
+set -s escape-time 0
# Vim mode
set-option -g status-keys vi
set-window-option -g mode-keys vi
-# Highlight active window
-set-window-option -g window-status-current-bg red
-
# Easy config reload
-bind r source-file /Users/twymer/.tmux.conf
-
-# Hack to reenable pbcopy/pbpaste
-# http://writeheavy.com/2011/10/23/reintroducing-tmux-to-the-osx-clipboard.html
-# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
-#set-option -g default-command "reattach-to-user-namespace -l zsh"
-set -g default-terminal "screen-256color"
-
-set-option -g default-shell /bin/zsh
+# bind r source-file ~/.tmux.conf
+# reload tmux config
+unbind r
+bind r \
+ source-file ~/.tmux.conf \;\
+ display 'Reloaded tmux config.'
+
+# easily toggle synchronization (mnemonic: e is for echo)
+# sends input to all panes in a given window.
+bind e setw synchronize-panes on
+bind E setw synchronize-panes off
+
+# reminder
+# Tmux zoom via prefix z
+## This is native as of 1.8 (prefix z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment