2017-05-21 14:02:16 +02:00
|
|
|
# Set $TERM env
|
|
|
|
set -g default-terminal "screen-256color"
|
|
|
|
|
2017-05-22 13:20:54 +02:00
|
|
|
# No escape delay, so that one can still use vim
|
|
|
|
set -sg escape-time 0
|
|
|
|
|
2017-05-21 14:02:16 +02:00
|
|
|
# Set prefix to ^A
|
|
|
|
unbind C-b
|
|
|
|
set -g prefix C-a
|
|
|
|
bind C-a send-prefix
|
|
|
|
|
|
|
|
# Navigation
|
|
|
|
## Navigation in panes with C+hjkl integrated with vim
|
|
|
|
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
|
|
|
|
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
|
|
|
|
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
|
|
|
|
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
|
|
|
|
## Navigation in windows with alt+shift+jk
|
|
|
|
bind -n M-j select-window -p
|
|
|
|
bind -n M-k select-window -n
|
|
|
|
|
2017-05-22 13:20:54 +02:00
|
|
|
# Resizing
|
|
|
|
## Resize panes through C-M-{hjkl}
|
|
|
|
bind -n C-M-h resize-pane -L
|
|
|
|
bind -n C-M-j resize-pane -D
|
|
|
|
bind -n C-M-k resize-pane -U
|
|
|
|
bind -n C-M-l resize-pane -R
|
|
|
|
|
2017-05-21 14:02:16 +02:00
|
|
|
# Splitting
|
|
|
|
unbind %
|
|
|
|
unbind '"'
|
2017-05-30 16:31:15 +02:00
|
|
|
bind | split-window -h -c "#{pane_current_path}"
|
|
|
|
bind - split-window -v -c "#{pane_current_path}"
|
|
|
|
|
|
|
|
# New windows use the same working directory
|
|
|
|
bind c new-window -c "#{pane_current_path}"
|
2017-05-21 14:02:16 +02:00
|
|
|
|
|
|
|
# Set window notifications
|
|
|
|
setw -g monitor-activity on
|
|
|
|
set -g visual-activity on
|
|
|
|
|
|
|
|
# Reload tmux conf
|
|
|
|
unbind r
|
|
|
|
bind r source-file ~/.tmux.conf \; display-message " Config reloaded".
|
|
|
|
|
|
|
|
|
|
|
|
# Status bar
|
2017-05-21 14:33:38 +02:00
|
|
|
set -g status-bg colour237
|
|
|
|
set -g status-fg colour216
|
|
|
|
set -g status-attr dim
|
2017-05-21 14:02:16 +02:00
|
|
|
set-option -g status-left '#[fg=colour196][#[fg=default]#S#[fg=colour196]]#[fg=default] '
|
|
|
|
set-option -g status-right \
|
2017-05-21 14:33:38 +02:00
|
|
|
'#[fg=colour196][#[fg=default]#(echo $USER)#[fg=colour196]@\
|
2017-05-21 14:02:16 +02:00
|
|
|
#[fg=default]#h#[fg=colour196]]#[fg=default] \
|
|
|
|
#[fg=colour196][#[fg=default]#(date "+%H:%M %F")#[fg=colour196]]#[fg=defaultb'
|
|
|
|
|
|
|
|
# Current window
|
|
|
|
set-window-option -g window-status-current-bg colour215
|
|
|
|
set-window-option -g window-status-current-fg colour88
|
|
|
|
set-window-option -g window-status-current-format ' #I:#W#F '
|