# 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 mouse on set -g status off set -g base-index 1 set -g mode-keys vi set -sg escape-time 1 set -g visual-activity on setw -g pane-base-index 1 set -g history-limit 10000 setw -g monitor-activity on # border colours set -g pane-border-style fg=colour0 set -g pane-active-border-style fg=colour0 # 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 ' '" # 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