|
# vim:fdm=marker |
|
|
|
# --- Basics {{{ |
|
|
|
# UTF8 |
|
set -g utf8 |
|
set-window-option -g utf8 on |
|
|
|
# Non-stupid scrolling |
|
set -g terminal-overrides 'xterm*:smcup@:rmcup@' |
|
set -g mode-mouse on |
|
|
|
# Default shell |
|
set-option -g default-shell "/bin/zsh" |
|
|
|
# Default terminal |
|
set -g default-terminal "screen-256color" |
|
|
|
# Faster command sequences |
|
set -sg escape-time 0 |
|
|
|
# More obvious panes |
|
set-option -g pane-active-border-fg colour10 |
|
|
|
# Vim keys |
|
setw -g mode-keys vi |
|
|
|
# Status line |
|
set -g status on |
|
setw -g monitor-activity on |
|
set -g visual-activity on |
|
set-window-option -g status-left " #S " |
|
set-window-option -g status-left-fg black |
|
set-window-option -g status-left-bg white |
|
set-window-option -g status-right " %H:%M %d-%b-%y " |
|
set-window-option -g status-right-fg black |
|
set-window-option -g status-right-bg white |
|
set-window-option -g window-status-format " #I: #W " |
|
set-window-option -g window-status-current-format " #I: #W " |
|
set-window-option -g window-status-current-fg green |
|
set-window-option -g window-status-current-bg black |
|
|
|
# --- Basics }}} |
|
|
|
# --- Mappings {{{ |
|
|
|
# Copy mode |
|
bind -n C-Space copy-mode |
|
bind ESCAPE copy-mode |
|
bind -t vi-copy v begin-selection |
|
bind -t vi-copy y copy-selection |
|
bind -t vi-copy V rectangle-toggle |
|
bind ] paste-buffer |
|
|
|
# Pane/Window management |
|
bind -n M-\ split-window -h -c '#{pane_current_path}' |
|
bind -n M-- split-window -v -c '#{pane_current_path}' |
|
bind -n M-= select-layout even-horizontal |
|
bind -n M-+ select-layout even-vertical |
|
bind -n M-j next-window |
|
bind -n M-k previous-window |
|
bind -n M-s send-keys C-z \; send-keys " reset && fg > /dev/null" \; send-keys "Enter" |
|
|
|
# Pane navigation |
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' |
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" |
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" |
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" |
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" |
|
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" |
|
|
|
# Pane resizing |
|
bind-key -nr M-Up resize-pane -U |
|
bind-key -nr M-Down resize-pane -D |
|
bind-key -nr M-Left resize-pane -L |
|
bind-key -nr M-Right resize-pane -R |
|
bind-key -nr M-z resize-pane -Z |
|
|
|
# Session management |
|
bind-key -n M-8 choose-session |
|
bind-key -n M-9 switch-client -p |
|
bind-key -n M-0 switch-client -n |
|
|
|
# General |
|
bind-key -t vi-edit C-u delete-line |
|
|
|
# Set new window dir to current pane's |
|
bind c new-window -c "#{pane_current_path}" |
|
|
|
# --- Mappings }}} |