# set default shell set -g default-command "${SHELL}" # set prefix to ctrl+a set -g prefix C-a bind C-a send-prefix unbind C-b # reload configuration bind r source-file ~/.config/tmux/tmux.conf \; run "printf '# Reload tmux configuration\n' | tmux load-buffer - && tmux paste-buffer" # settings set -g base-index 1 set -g history-limit 10000 set -g mode-keys vi set -g monitor-activity on set -g mouse on set -g pane-base-index 1 set -g pane-border-format "" set -g pane-border-status top set -g status on set -g status-left '' set -g status-position top set -g status-right '' set -g visual-activity off set -sg escape-time 1 setw -g window-status-current-format " #I " setw -g window-status-format " #I " # colours set -g status-bg color0 set -g pane-border-style fg=colour9 set -g pane-active-border-style fg=colour9 setw -g window-status-style fg=colour3 setw -ga window-status-current-style bg=color9 # cycle windows bind -n S-Right next-window # shift + --> bind -n S-Left previous-window # shift + <-- # y and p as in vim unbind p bind -n M-p paste-buffer bind -n M-e copy-mode bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send -X begin-selection bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel \; run "tmux save-buffer - | xsel -i" # middle mouse paste bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i" bind -T root MouseDown2Pane run -b "xsel -o | tmux load-buffer - && tmux paste-buffer -s ' '" # double click select bind-key -n DoubleClick1Pane \ select-pane \; \ copy-mode -M \; \ send-keys -X select-word \; \ run-shell "sleep .25s" \; \ send-keys -X copy-pipe-and-cancel "xsel -i" # triple click select bind-key -n TripleClick1Pane \ select-pane \; \ copy-mode -M \; \ send-keys -X select-line \; \ run-shell "sleep .25s" \; \ send-keys -X copy-pipe-and-cancel "xsel -i" # split pane commands bind | split-window -h bind - split-window -v # alt vim keys without prefix key to switch panes bind -n M-h select-pane -L bind -n M-j select-pane -D bind -n M-k select-pane -U bind -n M-l select-pane -R # alt arrow keys without prefix key to switch panes bind -n M-Down select-pane -D bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U # alt vim keys without prefix to resize panes bind -n M-H resize-pane -L 5 bind -n M-J resize-pane -D 5 bind -n M-K resize-pane -U 5 bind -n M-L resize-pane -R 5 # session saving set -g @resurrect-processes 'make hugo dmesg journalctl' run-shell ~/.config/tmux/plugins/tmux-resurrect/resurrect.tmux