# vim:ft=conf: # Primer: https://danielmiessler.com/study/tmux/ # Tmux for mere mortals: https://zserge.com/posts/tmux/ # gitmux: https://github.com/arl/gitmux # syntax highlighting in Vim set -g default-terminal "screen-256color" # increase history limit set -g history-limit 10000 # start numbering windows from 1 instead of zero set -g base-index 1 set-option -g renumber-windows on # Faster escape sequences (default is 500ms). # This helps when exiting insert mode in Vim: http://superuser.com/a/252717/65504 set -s escape-time 50 # https://zserge.com/posts/tmux/ bind-key -n M-n new-window -c "#{pane_current_path}" 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 M-0 select-window -t :0 bind-key -n M-. select-window -n bind-key -n M-, select-window -p bind-key -n M-< swap-window -t -1 bind-key -n M-> swap-window -t +1 bind-key -n M-X confirm-before "kill-window" bind-key -n M-v split-window -h -c "#{pane_current_path}" bind-key -n M-b split-window -v -c "#{pane_current_path}" bind-key -n M-R command-prompt -I "" "rename-window '%%'" bind-key -n M-f resize-pane -Z bind-key -n M-h select-pane -L bind-key -n M-l select-pane -R bind-key -n M-k select-pane -U bind-key -n M-j select-pane -D bind-key -n M-Left select-pane -L bind-key -n M-Right select-pane -R bind-key -n M-Up select-pane -U bind-key -n M-Down select-pane -D bind-key -n "M-H" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old' bind-key -n "M-J" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old' bind-key -n "M-K" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old' bind-key -n "M-L" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old' bind-key -n "M-S-Left" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old' bind-key -n "M-S-Down" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old' bind-key -n "M-S-Up" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old' bind-key -n "M-S-Right" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old' bind-key -n M-x confirm-before "kill-pane" bind-key -n M-/ copy-mode # Copy to clipboard macOS bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy" # enable for iTerm (Terminal.app doesn't have mouse support) set -g mouse on # enable clipboard http://goo.gl/DN82E # enable RubyMotion http://goo.gl/WDlCy set -g default-command "reattach-to-user-namespace bash -l" set-option -g status-keys vi set-option -g set-titles on set-option -g set-titles-string 'tmux - #W' set -g bell-action any set-option -g visual-bell off set-option -g set-clipboard off setw -g mode-keys vi setw -g monitor-activity on set -g visual-activity on # set -g status-style fg=colour15 # set -g status-justify centre # set -g status-left '' # set -g status-right '' set -g status-interval 1 # set -g message-style fg=colour0,bg=colour3 # setw -g window-status-bell-style fg=colour1 # setw -g window-status-current-style fg=yellow,bold # setw -g window-status-style fg=colour250 # setw -g window-status-current-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} ' # setw -g window-status-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} ' # disable programs changing window names via terminal escape sequence # set-window-option -g allow-rename off # status bar set -g status-style fg=colour8,bg=colour234 # current session set -g status-left ' #S ' set -g status-left-length 15 set -g status-left-style fg=colour229,bg=colour166 # window list set -g window-status-format "#[fg=colour8] #I #[fg=colour231]#W#[fg=colour166]#F " set -g window-status-current-format "#[fg=colour117,bg=colour31] #I #[fg=colour231]#W#[fg=colour234]#F " set -g window-status-separator "" # disable possibly set visual editor set-environment -gu GEM_EDITOR # load any local config if-shell "test -f $HOME/.tmux.conf.local "source $HOME/.tmux.conf.local # source this file after changes bind R source-file ~/.tmux.conf