Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (54 sloc) 2.05 KB
## keybindings ##
# screen-like
set -g prefix C-q
bind C-q last-window
# tmux inside tmux
bind q send-prefix
bind -n C-s send-prefix
setw -g mode-keys vi
# from http://blog.sanctum.geek.nz/vi-mode-in-tmux/
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# vi-style pane switch
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
bind 'c' new-window -c '#{pane_current_path}'
bind '"' split-window -c '#{pane_current_path}'
bind '%' split-window -h -c '#{pane_current_path}'
# vim-tmux-navigator
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"
# . = move, > = swap
bind > command-prompt "swap-window -t '%%'"
## behaviors ##
set -s escape-time 0
set -g base-index 1
setw -g aggressive-resize on
set -g default-terminal screen-256color
## layouts ##
set -g status-bg black
set -g status-fg white
prefix='#{?client_prefix,#[bg=cyan]#[fg=white]^Q#[bg=default]#[fg=white], }'
set -g status-left-length 20
set -g status-left "$prefix#[fg=green]#S#[fg=default]#[bg=default] "
# sync to .thymerc: tmux_theme
set -g status-right "#(cat ~/.thyme-tmux)#[fg=black]#[bg=blue] #[bg=blue,fg=white] %Y-%m-%d %H:%M "
set -g status-interval 1
status_color="#{?window_bell_flag,red,#{?window_active,blue,black}}"
status_prefix="#[bg=$status_color]#[fg=#{status-bg}]#[fg=default]"
status_postfix="#[bg=black]#[fg=$status_color]"
status_format="$status_prefix #[bg=$status_color]#I: #W $status_postfix"
setw -g window-status-separator ""
setw -g window-status-format "$status_format"
setw -g window-status-last-style underscore
setw -g window-status-current-format "$status_format"