############################################### # # dependencies: # brew install reattach-to-user-namespace # for macvim #set -g prefix ^O #unbind ^b #bind o send-prefix unbind-key C-b set -g prefix 'C-\' bind-key 'C-\' send-prefix set -g status-fg white #set -g status-bg blue #set -g status-bg black set-window-option -g window-status-current-bg red #set-option -g status-right "#[fg=green]#T #[fg=yellow,bold]#(date '+%Y-%m-%d %I:%M%P %a') " #set-option -g status-right "#[fg=green]#(whoami) #[fg=yellow,bold]#(date '+%Y-%m-%d') #[fg=red,bold]#(date '+%I:%M') #[fg=yellow,bold]#(date '+%p %a') " set-option -g status-right-length 60 set-option -g status-right "#[fg=yellow]#h #[fg=red]#(echo $TMUX_IP) #[fg=yellow]#(date '+%Y-%m-%d') #[fg=red]#(date '+%I:%M') #[fg=yellow]#(date '+%p %a') " if-shell 'test "$(uname)" = "Darwin"' 'set -g status-bg black' 'set -g status-bg blue' ## automatic change the window title #set-option -g set-titles on #set-option -g set-titles-string '#T' #set-option -g set-titles-string "#(date '+%I:%M %P %a')" #set-window-option -g automatic-rename on set-option -g allow-rename off #http://unix.stackexchange.com/questions/12032/create-new-window-with-current-directory-in-tmux bind-key -n "M-t" new-window #-c '#{pane_current_path}' bind-key -n "M-n" next-window bind-key -n "M-p" previous-window bind-key -n "M-Space" last-window bind-key -n "M-`" select-window -t:0 bind-key -n "M-1" select-window -t:1 bind-key -n "M-2" select-window -t:2 bind-key -n "M-3" select-window -t:3 bind-key -n "M-4" select-window -t:4 bind-key -n "M-5" select-window -t:5 bind-key -n "M-6" select-window -t:6 bind-key -n "M-7" select-window -t:7 bind-key -n "M-8" select-window -t:8 bind-key -n "M-9" select-window -t:9 #bind-key -n "C-M-h" split-window -h #bind-key -n "C-M-v" split-window -v bind-key -n "M-v" split-window -h -c '#{pane_current_path}' bind-key -n "M-s" split-window -v -c '#{pane_current_path}' ##bind-key "o" select-pane -l ##bind-key "j" select-pane -D ##bind-key "k" select-pane -U ##bind-key "h" select-pane -R ##bind-key "l" select-pane -L bind-key "C-h" resize-pane -L 3 bind-key "C-j" resize-pane -D 3 bind-key "C-k" resize-pane -U 3 bind-key "C-l" resize-pane -R 3 bind-key -n "M-j" select-pane -D bind-key -n "M-k" select-pane -U bind-key -n "M-l" select-pane -R bind-key -n "M-h" select-pane -L #bind-key -n "M-o" select-pane -l set-option -g mode-keys vi ##set-window-option -g utf8 on bind-key -n "M-i" copy-mode # refer http://askubuntu.com/questions/350718/problem-regarding-tmux-copy-mode # $ tmux list-keys -t vi-copy bind-key -t vi-copy "v" begin-selection bind-key -t vi-copy "Space" page-down bind-key -t vi-copy "BSpace" page-up bind-key -t vi-copy "y" copy-selection bind-key -t vi-copy "K" halfpage-up bind-key -t vi-copy "J" halfpage-down #http://unix.stackexchange.com/questions/15715/getting-tmux-to-copy-a-buffer-to-the-clipboard bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" ### mouse enable # Reload tmux config #bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf \; display "Reloaded!" #set-option -g mouse-select-window on #set-option -g mouse-select-pane on #set-option -g mouse-resize-pane on #set-option -g mouse-utf8 on #set-window-option -g mode-mouse on #set -g default-terminal "screen-256color" ## macvim starting from tmux does't have "+ register, cannot using command+v to paste # https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/Usage.md # http://stackoverflow.com/questions/16618992/cant-paste-into-macvim # set-option -g default-command 'reattach-to-user-namespace -l "$SHELL"' set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l "$SHELL" || exec "$SHELL"' #set-option -g pane-border-fg colour235 #base02 # set-option -g pane-active-border-fg colour240 #base01 #set -g status-justify centre #setw -g monitor-activity on # set -g visual-activity on # set-window-option -g window-status-fg brightblue #base0 # set-window-option -g window-status-bg colour236 # set-window-option -g window-status-attr dim # set-window-option -g window-status-current-fg brightred #orange # set-window-option -g window-status-current-bg colour236 # set-window-option -g window-status-current-attr bright set-option -g base-index 1 setw -g pane-base-index 1 set-option -sg escape-time 0 #http://www.tylercipriani.com/2013/09/12/important-lines-in-my-tmux.html #bind-key -n "M-\\" resize-pane -Z #\; display-message "Zoom zoom zoom" bind-key -n "M-o" resize-pane -Z #\; display-message "Zoom zoom zoom" set -g renumber-windows on set-option -g history-limit 10000