# Set default shell set -g default-shell /bin/bash # Increase history size set -g history-limit 50000 # Disable escape delay set-option -sg escape-time 0 # Enable mouse and focus events set -g mouse on set -g focus-events on ################ # Key bindings # ################ # Change prefix set-option -g prefix C-a # Remap split commands unbind '"' unbind % bind s split-window -v bind v split-window -h # Remap pane selection unbind Up unbind Down unbind Left unbind Right is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" bind-key -n 'M-h' if-shell "$is_vim" { send-keys M-h } { if-shell -F '#{pane_at_left}' {} { select-pane -L } } bind-key -n 'M-j' if-shell "$is_vim" { send-keys M-j } { if-shell -F '#{pane_at_bottom}' {} { select-pane -D } } bind-key -n 'M-k' if-shell "$is_vim" { send-keys M-k } { if-shell -F '#{pane_at_top}' {} { select-pane -U } } bind-key -n 'M-l' if-shell "$is_vim" { send-keys M-l } { if-shell -F '#{pane_at_right}' {} { select-pane -R } } # Remap resize unbind C-Up unbind C-Down unbind C-Left unbind C-Right unbind M-Up unbind M-Down unbind M-Left unbind M-Right bind -nr M-K resize-pane -U bind -nr M-J resize-pane -D bind -nr M-H resize-pane -L bind -nr M-L resize-pane -R ########## # Design # ########## # Borders set -g pane-border-style 'fg=colour12' set -g pane-active-border-style 'fg=colour12' # Statusbar set -g status-position bottom set -g status-justify left set -g status-style 'bg=colour235' set -g status-left '' # Command line and messages set -g message-style 'bg=color235' set -g display-time 4000 # Tabs setw -g window-status-current-style 'bg=colour238 bold' setw -g window-status-current-format ' #[fg=color245]#I#[fg=colour250] #W ' setw -g window-status-style 'bg=colour236' setw -g window-status-format ' #[fg=colour240]#I#[fg=colour245] #W ' # Clock set -g status-right '#[fg=colour0,bg=colour240] %H:%M ' set -g status-interval 10 # Scroll number setw -g mode-style 'fg=colour240'