|
- # Setup utf8 by default and vi mode
- set-window-option -g utf8 on
- set-window-option -g mode-keys vi
- set-window-option -g aggressive-resize on
-
- set-option -g default-command zsh
- set-option -g default-terminal 'xterm-256color'
-
- # Status line options, mainly coloring
- set-window-option -g window-status-bg colour6
- set-window-option -g window-status-fg black
- set-window-option -g window-status-current-bg white
-
- # Status line options
- set-option -g status-bg black
- set-option -g status-fg colour7
- set-option -g status-left-length 24
- set-option -g status-left ''
- set-option -g status-right-length 13
- set-option -g status-right "%a %H:%M:%S"
- set-option -g status-interval 7
- set-option -g status-utf8 on
-
- # Pane border options, mimics the status line coloring
- set-option -g pane-border-bg colour15
- set-option -g pane-border-fg colour82
- set-option -g pane-active-border-bg colour15
- set-option -g pane-active-border-fg colour2
-
- # Alert related things
- set-option -g visual-activity on
- set-option -g visual-bell on
- set-option -g message-bg colour7
- set-option -g message-fg black
-
- # Pass through the window title and display it automatically on changes.
- set-option -g set-titles on
- set-option -g set-titles-string '#T'
- set-window-option -g automatic-rename on
-
- # Key rebinding to make things more au naturalle
- bind-key R \
- source-file ~/.tmux.conf \;\
- display 'reloaded tmux config'
-
- # Log pane output to a file, save with an iso8601 datestamp
- bind-key o \
- pipe-pane -o "cat >> $HOME/tmux-`iso8601`.log" \;\
- set-window-option window-status-current-fg green \;
-
- bind-key O \
- pipe-pane \;\
- set-window-option window-status-current-fg default \;
-
- bind-key N new-session -t default
-
- # Using s for synchronizing panes, means that s for choosing sessions
- # is now e
- unbind-key s # interactive select sessions
- bind-key e choose-tree
-
- # (un)synchronize panes with prefix-s
- bind-key s \
- if-shell \
- "tmux show-window-options | grep 'synchronize-panes on'" \
- "set-window-option window-status-current-bg colour7; \
- set-window-option pane-active-border-fg colour2; \
- set-window-option pane-active-border-bg colour15; \
- set-window-option synchronize-panes off; \
- display 'synchronization off'" \
- "set-window-option window-status-current-bg red; \
- set-window-option pane-active-border-fg red; \
- set-window-option pane-active-border-bg colour15; \
- set-window-option synchronize-panes on; \
- display 'synchronizing'"
-
- # same thing as ^ so it sets up things if we were started with
- # something else that set synchronization.
- if-shell \
- "tmux show-window-options | grep 'synchronize-panes on' || /bin/true" \
- "set-window-option window-status-current-bg red; \
- set-window-option pane-active-border-fg yellow; \
- set-window-option pane-active-border-bg red"
-
- # Setup splits to be less annoying
- bind-key \ split-window -h
- bind-key - split-window -v
-
- # vi keybindings for pane navigation
- bind-key k select-pane -U
- bind-key j select-pane -D
- bind-key h select-pane -L
- bind-key l select-pane -R
-
- # Make it so that I can detach/etc while holding control down,
- # PURE LAZY
- bind-key C-d detach
- bind-key C-n next-window
- bind-key C-p previous-window
-
- bind-key C-k select-pane -U
- bind-key C-j select-pane -D
- bind-key C-h select-pane -L
- bind-key C-l select-pane -R
-
- # Non confirming kill pane plskthxbai
- bind-key x kill-pane
-
- # In case something I run exits straight away, i'd like to know about it.
- set-option -g set-remain-on-exit on
-
- # Lets change the prefix key so we don't clobber emacs back one char key
- unbind-key C-b
-
- # hacky, but C-\ isn't used by anything overly important in emacs
- set-option -g prefix 'C-\'
-
- # two C-\'s == C-\, if i need it, likely not
- bind 'C-\' send-prefix
-
- # Delay in sending things is dumb
- set-option -s escape-time 1
-
- # so we can scroll the mouse, select panes, etc...
- set-window-option -g mode-mouse on
- set-window-option -g mouse-select-pane on
- set-window-option -g mouse-resize-pane on
- set-window-option -g mouse-select-window on
-
- # Mouse mode can be stupid at times, so make it toggleable.
- bind-key m \
- if-shell \
- "tmux show-window-options | grep 'mode-mouse on'" \
- "set-window-option mode-mouse off; \
- set-window-option mouse-select-pane off; \
- set-window-option mouse-resize-pane off; \
- set-window-option mouse-select-window off; \
- display 'Mouse modes off'" \
- "set-window-option mode-mouse on; \
- set-window-option mouse-select-pane on; \
- set-window-option mouse-resize-pane on; \
- set-window-option mouse-select-window on; \
- display 'Mouse modes on'"
-
- # Assume linux for things, load osx stuff only on osx
- bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
- bind C-y run "tmux save-buffer - | xclip -i"
-
- # Linux specific. Now that I installed rainbarf on things, why not use it.
- if-shell 'test "$(uname)" = "Linux"' \
- "set-option -g status-right-length 55; \
- set-option -g status-right '#(rainbarf --bright --width 25) %a %H:%M:%S'; "
-
- # osx specific
- # Have to modify default command so I can ssh in.
- # that and rainbarf output is 42 chars long (utf8) but helpful.
- if-shell 'test "$(uname)" = "Darwin"' \
- "set-option -g default-command 'reattach-to-user-namespace -l zsh'; \
- set-option -g status-right-length 55; \
- set-option -g status-right '#(rainbarf --remaining --bolt --bright --width 25) %a %H:%M:%S'; "
|