# .tmux.conf # vi mode #set-option -g default-shell "/usr/local/bin/zsh" #set-option -g default-command "/usr/local/bin/zsh" #set -g default-command "${SHELL}" set-window-option -g mode-keys vi # Some tweaks to the status line set -g status-right "%H:%M" set -g status-right-style fg=color245 # If running inside tmux ($TMUX is set), then change the status line to red %if #{TMUX} set -g status-bg red %endif # Enable RGB colour if running in xterm(1) set-option -sa terminal-overrides ",xterm*:Tc" # Change the default $TERM to screen set -g default-terminal "xterm-256color" # No bells at all set -g bell-action none # close panes after command has finished set -g remain-on-exit off # Change the prefix key to C-a set -g prefix C-a unbind C-b bind C-a send-prefix # Turn the mouse on, but without copy mode dragging set -g mouse on # multiple places bind F set -w window-size # Keys to toggle monitoring activity in a window and the synchronize-panes option bind m set monitor-activity bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}' # Start windows and panes at 1, not 0 set -g base-index 1 setw -g pane-base-index 1 # reload ~/.tmux.conf using PREFIX r bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!" # default statusbar colors set -g status-style bg=default,fg=yellow #yellow # default window title colors set -g window-status-style fg=brightblue,bg=default # active window title colors set -g window-status-current-style fg=black,bg=blue # pane border set -g pane-border-style fg=black #base02 set -g pane-active-border-style fg=black #base01 # message text set -g message-style bg=black,fg=brightred #orange # pane number display set-option -g display-panes-active-colour blue #blue set-option -g display-panes-colour brightred #orange # clock set-window-option -g clock-mode-colour green #green # vim key bindings setw -g mode-keys vi bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R bind-key -r C-h select-window -t :- bind-key -r C-l select-window -t :+ # resize panes using PREFIX H, J, K, L bind H resize-pane -L 5 bind J resize-pane -D 5 bind K resize-pane -U 5 bind L resize-pane -R 5 # copy and paste set-window-option -g automatic-rename on # toggle statusbar bind-key s set -g status # copying selection vim style bind-key Escape copy-mode # enter copy mode; default [ bind-key p paste-buffer # paste; (default hotkey: ] ) bind-key P choose-buffer # tmux clipboard history bind-key + delete-buffer \; display-message "Deleted current Tmux Clipboard History" # Note: rectangle-toggle (aka Visual Block Mode) > hit v then C-v to trigger it bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi V send-keys -X select-line bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle bind-key -T choice-mode-vi h send-keys -X tree-collapse bind-key -T choice-mode-vi l send-keys -X tree-expand bind-key -T choice-mode-vi H send-keys -X tree-collapse-all bind-key -T choice-mode-vi L send-keys -X tree-expand-all bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy && wl-paste -n | wl-copy -p" bind-key p run "wl-paste -n | tmux load-buffer - ; tmux paste-buffer" # urlview as context and url view bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; \ new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"' # tmux auto rename pane set-option -g status-interval 1 set-option -g allow-rename on set-option -g automatic-rename on set-option -g automatic-rename-format "#{?#{==:#{pane_current_command},zsh},#{b:pane_title},#{pane_current_command}}" # tmux title program name set-option -g set-titles on set-option -g set-titles-string "#W"