Permalink
Find file
e7f8014 Oct 22, 2015
154 lines (111 sloc) 3.91 KB
# vim: foldmethod=marker
# {{{1 global options
# redefine the prefix key
set -g prefix C-o
set -g base-index 0
set -g bell-action none
unbind C-b
bind o send-prefix
# set -g visual-content on
set -g display-panes-time 3000
set -g default-terminal "screen-256color"
# C-m means Enter
setw -g monitor-activity off
set-option -g set-titles on
set-option -g set-titles-string "#{session_name} - #{host}"
# }}}1
# {{{1 key bindings
bind c new-window -c "#{pane_current_path}"
bind C-o last-window
bind k select-pane -U
bind j select-pane -D
bind C-k select-pane -U
bind C-j select-pane -D
bind h select-pane -L
unbind l
bind l select-pane -R
bind C-h select-pane -L
bind C-l select-pane -R
bind -r = resize-pane -U 3
bind -r - resize-pane -D 3
bind -r + resize-pane -L 3
bind -r _ resize-pane -R 3
#bind -r C-k rotate-window -U
#bind -r C-j rotate-window -D
bind -r K swap-pane -U
bind -r J swap-pane -D
#bind -r H swap-pane -L
#bind -r L swap-pane -R
bind -r C-n next-window
bind -r C-p previous-window
bind -r y next-layout
#bind o select-layout "active-only"
#bind O select-layout "main-vertical"
bind '"' choose-window
bind "'" choose-session
bind s split-window -h -c "#{pane_current_path}"
bind S split-window -v -c "#{pane_current_path}"
bind q kill-pane
bind Q kill-window
bind i display-panes
bind A command-prompt "rename-window %%"
bind m command-prompt "setw monitor-content %%"
# swap current pane with the input pane
# possible inputs: panel:misc.1(session-name:window-name.pane-index), bash(window-name, pane-index default is 0), 2(window-index)
bind C-s command-prompt "swap-pane -s %%"
# bindings for vi-* mode
bind -t vi-choice C-b page-up
bind -t vi-copy C-b page-up
bind C-d pipe-pane -o '~/.tmux/pipes/rdb'
bind C-f pipe-pane -o '~/.tmux/pipes/notification'
bind-key & command-prompt -p 'join with:' 'join-pane -h -t %%'
#}}}1
# {{{1 window options
# disable automatic window renaming
setw -g automatic-rename off
# enable utf8
setw -g utf8 on
setw -g xterm-keys on
# use vi mode in scroll mode and paste mode
setw -g mode-keys vi
#setw -g mode-fg black
#setw -g mode-bg yellow
#setw -g window-status-fg white
#setw -g window-status-bg black
setw -g window-status-current-attr reverse
# }}}1
# {{{1 status bar
set -g status-keys vi
set -g display-time 2000
set -g status-utf8 on
set -g status-bg cyan
# fix tmux slow issue. seems status update will cause too many context switches of notifyd process
set -g status-interval 0
#set -g status-interval 60
#set -g status-fg black
#set -g status-bg white
#set -g message-fg black
#set -g message-bg white
# for no-unicode terminal
#set -g status-left-length 16
#set -g status-right-length 50
#set -g status-left '#[fg=magenta,bold][#14H:#S]#[default]'
#set -g status-right '|#[fg=magenta,bold]#(load.sh)#[default]| #[fg=yellow,bold][%a %m/%d %H:%M]#[default]'
# for unicode terminal
set -g status-left-length 60
set -g status-right-length 1000
set -g status-left ' ❐ #[fg=magenta,bold]#S#[default] ▐ '
set -g status-right '▐ ❖ #[fg=magenta,bold]#(load.sh)#[default]▐ #[fg=yellow,bold]%a %m/%d %H:%M#[default]▐ #[fg=green]@#H#[default]'
#set -g status-right '▐ ⓔ #[fg=magenta,bold]#(~/mytools/new_mail.sh)#[default]▐ ♫ #[fg=green]#(mpc current)#[default]▐ ❖ #[fg=magenta,bold]#(load.sh)#[default]▐ ⌚ #[fg=yellow,bold]%a %m/%d %H:%M#[default]▐ #[fg=green]@#H#[default]'
# }}}1
# {{{1 macosx copy/paste wrapper
# need to compile tmux wrapper script first
# $ git clone https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git
# $ cd tmux-MacOSX-pasteboard/
# $ make reattach-to-user-namespace
# $ sudo mv reattach-to-user-namespace /usr/local/bin
set -g default-command "tmux rename-window shell; reattach-to-user-namespace -l /bin/bash"
#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"
# }}}1
#source-file '/Users/vincent/.tmux.conf.local'