set -g default-terminal "xterm-256color" set-option -gas terminal-overrides "*:Tc" set-option -gas terminal-overrides "*:RGB" set -g mouse on set -g set-clipboard external set -g escape-time 10 # https://www.johnhawthorn.com/2012/09/vi-escape-delays/ set -g history-limit 10000 set-option -g status-position top set-window-option -g allow-rename off set -g allow-rename off # remap prefix from 'C-b' to 'C-x', 0x18 hex code for iterm2 unbind C-b set-option -g prefix C-x bind-key C-x send-prefix unbind C-z # https://superuser.com/questions/1291278/accidentally-stop-the-tmux-job-via-remote-shell # reload config file (change file location to your the tmux.conf you want to use) bind r source-file ~/.tmux.conf \; display "Reloaded!" # split panes using | and - bind | split-window -h bind - split-window -v unbind '"' unbind % # switching and creating windows using Shift-arrow without prefix bind -n S-down new-window bind -n S-left prev bind -n S-right next # and for split-keyboard bind -n C-down new-window bind -n C-left prev bind -n C-right next # resizing panes using Ctrl-Alt-arrows without prefix bind -n C-M-Up resize-pane -U 2 bind -n C-M-Down resize-pane -D 2 bind -n C-M-Left resize-pane -L 10 bind -n C-M-Right resize-pane -R 10 bind -n C-M-k resize-pane -U 2 bind -n C-M-j resize-pane -D 2 bind -n C-M-h resize-pane -L 10 bind -n C-M-l resize-pane -R 10 # switch panes using Alt-arrow without prefix bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" bind -n WheelDownPane select-pane -t= \; send-keys -M bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down ########################### # Colors ########################### # color status bar set -g status-style fg=white,bg=colour235 # color of message bar set -g message-style fg=black,bold,bg=colour107 # highlight current window setw -g window-status-style fg=cyan,bg=colour235 setw -g window-status-current-style fg=black,bold,bg=cyan # set color of active pane set -g pane-border-style fg=colour240,bg=default set -g pane-active-border-style fg=green,bg=default # To copy, left click and drag to highlight text in yellow, # once you release left click yellow text will disappear and will automatically be available in clibboard # # Use vim keybindings in copy mode setw -g mode-keys vi # Update default binding of `Enter` to also use copy-pipe unbind -T copy-mode-vi Enter if-shell '[[ $(uname -s) = Linux ]]' { bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard" } { bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" }